How to fix the misconfiguration of DNS for python app

0 votes

I have containerized my python application. I need to set my own DNS server address to make pip work properly.

I want to change the DNS settings of the Docker daemon. Can anyone help me with this?


Dec 12, 2018 in DevOps & Agile by Shubham
• 1,000 points

1 answer to this question.

0 votes

Based on what you have mentioned in your query, I assume that you have written a Dockerfile for your python application and have created a container as well.

Now here is what what you can try to set the DNS address for your python application.

Try changing the DNS settings of the Docker daemon. You can edit (or create) the configuration file at /etc/docker/daemon.json with the dns key, as following:

  "dns": ["your_dns_address", ""]

In the above command, the first element of the list is the address of your DNS server. The second item is the Google’s DNS which can be used when the first one is not available.

Before moving ahead, save daemon.json and restart the docker service by typing below commands::

sudo service docker restart

Once you think the DNS problem is fixed, retry to run the build command.

I hope that the above information will resolve your query.

answered Dec 12, 2018 by Damon Salvatore
• 5,980 points

Related Questions In DevOps & Agile

+5 votes
2 answers

How to program and get the Digital Ocean ID of the current Droplet from within the Droplet?

You can run curl within the ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by Atul
• 10,230 points
0 votes
1 answer

How to a run deployed app in Docker for Windows?

To deploy an ASP.NET web application to ...READ MORE

answered Aug 30, 2018 in DevOps & Agile by Tyrion anex
• 8,690 points
0 votes
2 answers

How to customize the RAM allocation on Docker for Windows?

Try this: docker update --cpu-shares 5120 -m 3000M ...READ MORE

answered Dec 7, 2018 in DevOps & Agile by Maverick
• 10,840 points
+2 votes
1 answer

Error: You might need to start Docker for Windows. How do i start the daemon?

Hi, If you are running containers with Docker, ...READ MORE

answered May 19, 2020 in DevOps & Agile by MD
• 95,320 points
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,140 points
+4 votes
1 answer

How to orchestrate a multi-tier web-app over swarm cluster ?

I understand from your query that you ...READ MORE

answered Dec 11, 2018 in DevOps & Agile by Damon Salvatore
• 5,980 points
0 votes
1 answer