DNS not working within docker containers when host uses dnsmasq and Google's DNS server are firewalled?

后端 未结 6 1415
难免孤独
难免孤独 2020-12-24 03:09

The symptom is: the host machine has proper network access, but programs running within containers can\'t resolve DNS names (which may appear to be \"can\'t access the netwo

6条回答
  •  渐次进展
    2020-12-24 03:54

    I just had to deal with this last night and eventually remembered that docker run has a set of options for handling it. I used --dns to specify the DNS server I want the container to use. Works like a champ and no need to hack my docker host. There are other options for the domain name and search suffixes.

提交回复
热议问题