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?

Thanks. 

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

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", "8.8.8.8"]
}

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
1 answer

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

You can run curl http://169.254.169.254/metadata/v1/id within the ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by Atul
• 10,240 points
3,475 views
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,700 points
1,220 views
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
5,532 views
+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,460 points
8,074 views
+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,020 points
2,719 views
+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
1,255 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP