Page 1 of 1

DNS resolution in a container

Posted: Mon Feb 08, 2021 5:50 pm
by AntexMv
ip address 192.168.X.Y/24
cat>/etc/resolv.conf<<EOF
nameserver 192.168.Z.Z
EOF

Dear Community Please advise. Above there is script written to linux container eve configuration tab in order to maintain dns resolution after container reload.
If it is entered manually when container loaded - it is works (ip setting works always - it is OK). But if it is entered in configuration tab and container reloaded -it does not work.
Seems I missed something. Thank you much all for future advise.

Re: DNS resolution in a container

Posted: Mon Feb 08, 2021 9:24 pm
by Uldis (UD)
# Set ip address and Default route
ip addr add 10.100.100.103/24 dev eth0 || true
ip route add default via 10.100.100.1 || true

# Set DNS server
cat > /etc/resolv.conf << EOF
nameserver 8.8.8.8
EOF

works always

Re: DNS resolution in a container

Posted: Thu Feb 11, 2021 12:07 pm
by AntexMv
Dear Uldis
Thank you much for your time
But it does not work. I test few times - all the same
Please see attachment. It should work but in reality - does not
After each container reloading need enter configuration again.
IP saved but not DNS resolv.conf
Very strange...Hope may be you could advise something
Regards, AntexMv

Re: DNS resolution in a container

Posted: Thu Feb 11, 2021 5:32 pm
by Uldis (UD)
if your eve is behind proxy then need other cfg for NAT cloud
and please, if you made startup cfg for docker, do wipe node and start from this cfg...