Join GitHub today
Cannot access .local domains in Docker #38531
I am trying to access devices on my network with .local domain, but it doesn't seem to work in Docker. I always get bad address for .local domains.
Steps to reproduce the issue:
Describe the results you expected:
Access .local domains.
Additional information you deem important (e.g. issue happens only occasionally):
Ping from host is working:
Docker demon config:
If I try to ping test1.local from Docker:
Additional environment details (AWS, VirtualBox, physical, etc.):
Which DNS server are the
Looks like this may be related to
Are you also seeing this after upgrading to Docker 18.09 ?
Looking at those changes, I wonder if
I upgraded from docker.io to docker-ce to get version 18.09.
Result is the same:
"Which DNS server are the .local domains registered in?"
if I understand the question well, my .local domains are managed by my router 192.168.1.1.
So, the daemon is configured to use
From the code I linked to (#38531 (comment)), I see that the container will get a copy of
Recent versions of Ubuntu use
To see if the DNS configuration is indeed the cause; could you try if it works if you manually override the DNS for the container?
I tried with
Let's go on the tests:
To confirm how DNS resolution is working on your host, did you have to log into the router and add
Busybox uses a different resolver to most Linux distributions, so rule that out as a problem can you please try the following commands in a Fedora container?
Finally please try the same thing in alpine. (Alpine uses busybox but it's easier to install additional packages)
N.B. Alpine and Busybox don't have
Some additional info: I am using Unifi USG router. If I log in to the router (192.168.1.1):
But then why I am able to ping .local domains from all clients behind that router? There is no other DNS server in my home. Maybe clients (iPhone, Mac, ubuntu server) have it's own DNS server which resolve .local domains?
I think this is a related issue:
I am pretty sure we have a Multicast DNS problem and this is not managed by router, but the host OS itself, because this is how mDNS works:
"When an mDNS client needs to resolve a host name, it sends an IP multicast query message that asks the host having that name to identify itself. That target machine then multicasts a message that includes its IP address. All machines in that subnet can then use that information to update their mDNS caches."
In the Fedora and Alpine containers, mDNS is not being used (there is no mdns in the Fedora
Dig shows that 192.168.1.1 doesn't know about
You could try following these instructions to enable mDNS in the Fedora container and see if it starts to work:
The main part is installing the
I'm afraid I can't find an example of using mDNS in busybox / Alpine.
For some reason it is still doesn't work under Fedora. It's pretty hard thing to make this work, maybe one day it will work better.
Should I close the issue?