Here is my /etc/resolve.conf file from my host machine. I have commented both the public nameservers
# Generated by NetworkManager
# nameserver 8.8.8.8
# nameserver 4.2.2.2
When I try to ping google.com from my host machine, it didn't work since I have commented the public DNS server.
ping: google.com: Name or service not known
Here is my /etc/resolve.conf file from the docker container
nameserver 127.0.0.11
options ndots:0
When I try to ping google.com from my docker container, it works.
PING google.com (216.58.209.14): 56 data bytes
64 bytes from 216.58.209.14: seq=0 ttl=117 time=131.562 ms
64 bytes from 216.58.209.14: seq=1 ttl=117 time=191.746 ms
Since docker container network by default resolves to /etc/resolve.conf file from host machine, then how this scenario works? And what does the /etc/resolve.conf file from docker container refers to? Please help me out to understand more on this.