Skip to content

local dns fails to resolve inside containers in 18.06, fine in 18.03.1 #2301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 2 tasks
cjw296 opened this issue Jul 27, 2018 · 7 comments
Closed
1 of 2 tasks

local dns fails to resolve inside containers in 18.06, fine in 18.03.1 #2301

cjw296 opened this issue Jul 27, 2018 · 7 comments

Comments

@cjw296
Copy link

cjw296 commented Jul 27, 2018

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

[root@6b3422bf9739 data]# ping <corporate hostname>
PING <corporate hostname> (<corporate ip>) 56(84) bytes of data.
64 bytes from <corporate hostname> (<corporate ip>): icmp_seq=1 ttl=37 time=2.30 ms

Actual behavior

root@53656989a860 data]# ping <corporate hostname>
ping: <corporate hostname>: Name or service not known

Information

This was working fine in 18.0.3.1, so I've downgraded to that, which is why there's no diagnostics dump.
It looks just like a search domain issue (ie: what ends up in /etc/resolv.conf when the container is instantiated...)

  • Windows Version: Widnows 10, 1803
  • Docker for Windows Version: 18.06

Steps to reproduce the behavior

  1. docker pull <local image based on RHEL>
  2. docker run -it <local image based on RHEL> bash
  3. ping <corporate ip>
@cjw296 cjw296 changed the title local dns fails to resolve in 18.06, fine in 18.03.1 local dns resolution fails to resolve in 18.06, fine in 18.03.1 Jul 27, 2018
@cjw296 cjw296 changed the title local dns resolution fails to resolve in 18.06, fine in 18.03.1 local dns fails to resolve in 18.06, fine in 18.03.1 Jul 27, 2018
@cjw296
Copy link
Author

cjw296 commented Jul 27, 2018

@pavlovpetr - I'm not sure this is the same issue, I can pull just fine, it's DNS resolution inside containers rather than while trying to pull. Any chance you could open a separate issue for your problem rather than confusing this github issue?

@cjw296 cjw296 changed the title local dns fails to resolve in 18.06, fine in 18.03.1 local dns fails to resolve inside containers in 18.06, fine in 18.03.1 Jul 27, 2018
@ahmetdursun
Copy link

+1 for this issue. I have same problem with 18.06 while everything works well in 18.03. I'm working behind corporate proxy.

@ahmetdursun
Copy link

I think I found a solution. Configure 18.06 docker daemon based on your host machine dns properties or etc/resolv.conf file from any container running with 18.03. For example you may need to add dns-search domains as follows:

"dns-search": [
"yourSearchDomainIfExists1",
"yourSearchDomainIfExists2"
]

I think new version has an issue to configure its dns properties based on host machine automatically. This solution works for me however there are still some network issues in new version.

@am-zigzag
Copy link

+1.

Adding search zigzag.local to /etc/resolv.conf fixes my issue.

(I am using docker run -it --rm --privileged --pid=host justincormack/nsenter1 to get inside the daemon.)

However, adding the following to the daemon settings (Docker for Windows -> Settings -> Daemon ->Advanced -> Apply) does not work for me. It doesn't seem to add anything to /etc/resolv.conf.

"dns-search": [
"zigzag.local"
],

Looking in the logs, I can see there was an ENOENT editing the /etc/resolv/conf file.

[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Setting handler to ignore all SIGPIPE signals
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Version is bbedcf42d9e6ba0afba65aca18dd5fc087192b13
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: System SOMAXCONN is 2147483647
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Will use a listen backlog of 32
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: No periodic Gc.compact enabled
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Starting port forwarding server on port_control_url:"//./pipe/dockerVpnKitControl" vsock_path:""
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Removed connection limit
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Starting port forwarding server on port_control_url:"hyperv-connect://c32b9093-3167-4207-a737-bce62df1d0ba" vsock_path:""
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Removed connection limit
[10:33:01.731][VpnKit         ][Info   ] vpnkit.exe: Connecting to c32b9093-3167-4207-a737-bce62df1d0ba:0B95756A-9985-48AD-9470-78E060895BE7
[10:33:01.732][VpnKit         ][Warning] vpnkit.exe: There is no database: using hardcoded network configuration values
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: DNS server configured with no builtin DNS names; everything will be forwarded
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: 2 upstream DNS servers are configured
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Disabling transparent HTTP redirection
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Updating resolvers to use upstream DNS servers 
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Secure random number generator is available
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Add(3): DNS configuration changed to: use upstream DNS servers 
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: DNS server configured with builtin DNS names [ gateway.docker.internal -> 192.168.65.1, docker.for.win.gateway.internal -> 192.168.65.1, docker.for.win.http.internal -> 192.168.65.1, host.docker.internal -> 192.168.65.2, docker.for.win.host.internal -> 192.168.65.2, docker.for.win.localhost -> 192.168.65.2, vm.internal -> 192.168.65.3 ]
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: 0 upstream DNS servers are configured
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: DNS configuration file C:\Users\AM\AppData\Roaming\Docker\resolv.conf has changed
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Reading DNS configuration from C:\Users\AM\AppData\Roaming\Docker\resolv.conf
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Watching DNS configuration file C:\Users\AM\AppData\Roaming\Docker\resolv.conf for changes
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: DHCP configuration file C:\Users\AM\AppData\Roaming\Docker\dhcp.json has changed
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Reading DHCP configuration file from C:\Users\AM\AppData\Roaming\Docker\dhcp.json
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Watching DHCP configuration file C:\Users\AM\AppData\Roaming\Docker\dhcp.json for changes
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Configuration server_macaddr = f6:16:36:bc:f9:c6; max_connection = None; dns_path = C:\Users\AM\AppData\Roaming\Docker\resolv.conf; dns = ; resolver = Upstream; domain = None; allowed_bind_addresses = 0.0.0.0; gateway_ip = 192.168.65.1; host_ip = 192.168.65.2; lowest_ip = 192.168.65.3; highest_ip = 192.168.65.254; dhcp_json_path = C:\Users\AM\AppData\Roaming\Docker\dhcp.json; dhcp_configuration = None; mtu = 1500; http_intercept = None; http_intercept_path = None; port_max_idle_time = 300; host_names = host.docker.internal, docker.for.win.host.internal, docker.for.win.localhost; gateway_names = gateway.docker.internal, docker.for.win.gateway.internal, docker.for.win.http.internal; vm_names = vm.internal; udpv4_forwards = ; pcap_snaplen = 128
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Connecting to c32b9093-3167-4207-a737-bce62df1d0ba:30D48B34-7D27-4B0B-AAAF-BBBED334DD59
[10:33:01.732][VpnKit         ][Error  ] vpnkit.exe: While watching /etc/resolv.conf: ENOENT
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: C:\Windows\System32\drivers\etc\hosts file has bindings for 
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Update DHCP configuration to { searchDomains = ZigZag.local; domainName = ZigZag.local }
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Updating DNS configuration to nameserver 10.0.20.230#53
[10:33:01.732][VpnKit         ][Info   ] order 0
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Updating resolvers to use upstream DNS servers nameserver 10.0.20.230#53
[10:33:01.732][VpnKit         ][Info   ] order 0
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Secure random number generator is available
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Remove(3): DNS configuration changed to: use upstream DNS servers nameserver 8.8.8.8#53
[10:33:01.732][VpnKit         ][Info   ] timeout 2000
[10:33:01.732][VpnKit         ][Info   ] order 0
[10:33:01.732][VpnKit         ][Info   ] nameserver 8.8.4.4#53
[10:33:01.732][VpnKit         ][Info   ] timeout 2000
[10:33:01.732][VpnKit         ][Info   ] order 0
[10:33:01.732][VpnKit         ][Info   ] vpnkit.exe: Add(3): DNS configuration changed to: use upstream DNS servers nameserver 10.0.20.230#53
[10:33:01.732][VpnKit         ][Info   ] order 0
[10:33:01.733][VpnKit         ][Info   ] vpnkit.exe: DNS server configured with builtin DNS names [ gateway.docker.internal -> 192.168.65.1, docker.for.win.gateway.internal -> 192.168.65.1, docker.for.win.http.internal -> 192.168.65.1, host.docker.internal -> 192.168.65.2, docker.for.win.host.internal -> 192.168.65.2, docker.for.win.localhost -> 192.168.65.2, vm.internal -> 192.168.65.3 ]
[10:33:01.733][VpnKit         ][Info   ] vpnkit.exe: 1 upstream DNS servers are configured

I know this was working fine previously, and have upgraded recently. (Not sure of exact versions.)

@am-zigzag
Copy link

This looks related: #2304

@cjw296
Copy link
Author

cjw296 commented Aug 7, 2018

Yep, let's track on #2304

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants