Share & learn

Through Innovative Digital Library

How to set permanent DNS for docker container.

Here we have internal DNS server which has to be integrated with upcoming docker container. could you please suggest how to perform this.


Posted by Alex on February 3rd 2018 21:16 PM

Steps 1: We can manually configure nameserver for container by putting nameservers entries into daemon.json file. if daemon.json file doesn't exist, please create it and append below nameserver entery. Steps 2: restart the docker service to reload the config file. Steps 3: Please execute the docker container.

cat /etc/docker/daemon.json 
"dns": [""""]

systemctl restart docker

docker container run 
-it --name newhost centos /bin/bash
Answer Question

Your email address will not be published. Required fields are marked *

  • Minimum 20 character

related questions

Most liked questions

Most answered questions

FBTH Refresh
FBTH Refresh
Forgot password
Ask a Question
Minimum 20 character
Minimum 20 character
Minimum 20 character
FBTH Refresh