Trick a docker containers DNS to resolve a different url
If you want a DNS lookup of one domain to resolve to another one, you have 2 options.


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


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.