DNS resolution issue

I’m having issues with the DNS resolution in Home Assistant. All my local hostnames are not resolved properly. Reboots don’t solve the issue. It’s not always the case though, it worked fine for quite some time and reappeared only a few days ago.

On the host (ssh root@hassio -p 22222):

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr B8:27:EB:7F:E7:62  
          inet addr:10.0.1.4  Bcast:10.0.1.255  Mask:255.255.255.0
          inet6 addr: xxxxxxxxxxxxxxxxxxxxx Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7110 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6594 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1139758 (1.0 MiB)  TX bytes:811329 (792.3 KiB)

$ cat /etc/resolv.conf 
# Generated by NetworkManager
search zzzz
nameserver 10.0.1.3  <- PiHole
nameserver 10.0.1.1  <- Router
nameserver 8.8.8.8   <- Google

$ nslookup syno
Server:    10.0.1.3
Address 1: 10.0.1.3 pihole

Name:      syno
Address 1: 10.0.1.2 syno.zzzz

Now the same thing from within the SSH addin (ssh root@hassio):

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 02:42:AC:1E:21:01  
          inet addr:172.30.33.1  Bcast:0.0.0.0  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:202 errors:0 dropped:0 overruns:0 frame:0
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:29652 (28.9 KiB)  TX bytes:16002 (15.6 KiB)

$ cat /etc/resolv.conf 
nameserver 127.0.0.11
options ndots:0

$ nslookup syno
nslookup: can't resolve '(null)': Name does not resolve

Name:      syno
Address 1: 10.0.1.2 syno.zzzz

And now from the homeassistant container (with docker exec from within the host):

$ cat /etc/resolv.conf 
nameserver 172.30.32.2
options ndots:0

$ nslookup syno
nslookup: can't resolve '(null)': Name does not resolve

nslookup: can't resolve 'syno': Name does not resolve

From that I can say that there’s something wrong with the way the DNS resolution is made from within containers. Anyone know how to fix this?

2 Likes

same problem here, the letsencrypt container (and the alternative ones that I have tried) are not able to resolve hostnames, making the addons unusable

Did you find a solution?

I did not :frowning:

I’m currently facing the same issue.
Seems that there is no solution so far.
Is anyone looking into this issue?

Hello All,

I face the same problem - can’t resolve any local DNS name even with DNS masq add on.
Any help would be appriciated!

Regards
Joris

I’m having the same problem on an intel Nuc. Can’t resolve dns issues. Changing dns servers and rebooting now. Maybe that will help. Can’t get duck dns to work (dns won’t resolve for let’s encrypt) and the hassio container can’t use https because of it I suppose.

Same issue here. I installed dnsmasq and internal name resolution has stopped working. I have just updated to the latest hassio version today.
The problem causes yr weather and no-ip services to fail. As soon as I uninstall dnsmasq and reboot the problem is fixed.
Any fix for this on the way?

Did anyone ever fix this issue?

I’m having this issue also, cannot ping a .local name on the network from a hass.io SSH session, but if I try:

/bin/avahi-resolve-host-name server.local

then it gives the correct IP address. However within the containers they are unable to find server.local

Maybe someone else can try avahi-resolve-host-name from an SSH session and see what happens?