Docker 101 : DNS - Domain Name Server - configuration for containers
Using a different DNS:
If we want our container to use a different DNS server we can mention it with the run command.
To check the DNS, we could get into the container and look at the "/etc/resolv.conf" file.
Once inside the container we check the "/etc/resolv.conf" file:
Using the host's DNS server:
We can also run the container without any DNS information.
The "/etc/resolv.conf" file in the container will look like our hosts "/etc/resolv.conf" file:
We can also specify the DNS globally on the docker host by putting the DNS information in a "daemon.json" in the "/etc/docker" directory:
Comments