Sample Header Ad - 728x90

Inconsistent docker resolv.conf behavior

0 votes
0 answers
379 views
I have 2 computer set up with Ubuntu 22.04.3 installed. They both have the same docker version (25.0.3, build 4debf41). However if I check the resolv.conf file in any container I create, the first one is copying the host resolv.conf whereas the other one has a file containing only the following line :
$ docker run -it --rm busybox
/ # cat /etc/resolv.conf
nameserver 10.0.2.3
/ #
The expected one looks like :
$ docker run -it --rm busybox
/ # cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 169.x.x.x
search c.my-org-domain.internal routeraabbcc.com lan
/ #
It is nearly the same as my host machine. I'm struggling to find the reason for this, because I need my container to re-use the host resolv.conf file which contains my organization dns.
Asked by b.moyet (1 rep)
Feb 15, 2024, 01:40 PM