Quantcast
Channel: User Recoba20 - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 17

Answer by Recoba20 for Trick a docker containers DNS to resolve a different url

$
0
0

If you want a DNS lookup of one domain to resolve to another one, you have 2 options.

  1. Modify the Container /etc/hosts file. By default any DNS lookup is done there. You schould do that in the Dockerfile.

Modify /etc/hosts in a Dockerfile

  1. Maintain your own DNS servers with all mapping records. On container runtime just pass the DNS server.

Docker docs

--dns The IP address of a DNS server.


Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>