DNS resolution in a container

Before posting something, READ the changelog, WATCH the videos, howto and provide following:
Your install is: Bare metal, ESXi, what CPU model, RAM, HD, what EVE version you have, output of the uname -a and any other info that might help us faster.

Moderator: mike

Post Reply
AntexMv
Posts: 3
Joined: Sat Dec 14, 2019 7:14 am

DNS resolution in a container

Post by AntexMv » Mon Feb 08, 2021 5:50 pm

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.

Uldis (UD)
Posts: 5084
Joined: Wed Mar 15, 2017 4:44 pm
Location: London
Contact:

Re: DNS resolution in a container

Post by Uldis (UD) » Mon Feb 08, 2021 9:24 pm

# 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

AntexMv
Posts: 3
Joined: Sat Dec 14, 2019 7:14 am

Re: DNS resolution in a container

Post by AntexMv » Thu Feb 11, 2021 12:07 pm

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
You do not have the required permissions to view the files attached to this post.

Uldis (UD)
Posts: 5084
Joined: Wed Mar 15, 2017 4:44 pm
Location: London
Contact:

Re: DNS resolution in a container

Post by Uldis (UD) » Thu Feb 11, 2021 5:32 pm

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...

Post Reply