This morning I restarted hass.io (currently running 0.97.2) and to my surprise all my Esphome.io devices went unavailable in home assistant. I must have done this hundreds of times over the last 6 months and haven’t had this issue. I started looking around on the forum and found a post someone made about their Esphome device’s IP changing. I tried removing the integration for one (of three) and adding it back with the local DNS name and it wouldn’t find it. When I used the IP, however, it found it right away!
I have a pihole server on my LAN for handling DNS and all my computers can see each other using the manually mapped DNS names for my network. I logged into my hassio machine using the ssh addon and started playing around. I noticed that there’s a new hassio dns
option so I messed with that a little but it didn’t seem to impact the results. One thing that I found VERY interesting is that I could just ping any of my LAN devices (wired or wifi) and sometimes they’d resolve and sometimes they would not. Almost 50/50:
core-ssh:~# ping pihole
ping: bad address 'pihole'
core-ssh:~# ping pihole
PING pihole (192.168.0.8): 56 data bytes
64 bytes from 192.168.0.8: seq=0 ttl=63 time=0.869 ms
64 bytes from 192.168.0.8: seq=1 ttl=63 time=0.785 ms
^C
--- pihole ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.785/0.827/0.869 ms
core-ssh:~# ping pihole
ping: bad address 'pihole'
core-ssh:~# ping pihole
PING pihole (192.168.0.8): 56 data bytes
64 bytes from 192.168.0.8: seq=0 ttl=63 time=0.986 ms
^C
--- pihole ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.986/0.986/0.986 ms
core-ssh:~# ping pihole
PING pihole (192.168.0.8): 56 data bytes
64 bytes from 192.168.0.8: seq=0 ttl=63 time=0.929 ms
^C
--- pihole ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.929/0.929/0.929 ms
core-ssh:~# ping pihole
PING pihole (192.168.0.8): 56 data bytes
64 bytes from 192.168.0.8: seq=0 ttl=63 time=0.886 ms
^C
--- pihole ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.886/0.886/0.886 ms
core-ssh:~# ping pihole
PING pihole (192.168.0.8): 56 data bytes
64 bytes from 192.168.0.8: seq=0 ttl=63 time=1.089 ms
^C
--- pihole ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.089/1.089/1.089 ms
core-ssh:~# ping pihole
ping: bad address 'pihole'
core-ssh:~#
I’ve found that it does this with every device I have tried on my LAN. I even tried restarting the hassio supervisor host, hoping that it’s just a glitch but that didn’t help either. I have a few other Linux machines on my LAN and when I ping FROM those machines it’s always 100% success. Any ideas what can cause this intermittent DNS resolution issue in hassio?
Here it is again with nslookup:
core-ssh:~# nslookup pihole
Server: 127.0.0.11
Address: 127.0.0.11#53
** server can't find pihole: NXDOMAIN
core-ssh:~# nslookup pihole
Server: 127.0.0.11
Address: 127.0.0.11#53
Name: pihole
Address: 192.168.0.8
** server can't find pihole: NXDOMAIN
core-ssh:~# nslookup pihole
Server: 127.0.0.11
Address: 127.0.0.11#53
Name: pihole
Address: 192.168.0.8
core-ssh:~# nslookup pihole
Server: 127.0.0.11
Address: 127.0.0.11#53
Name: pihole
Address: 192.168.0.8
** server can't find pihole: NXDOMAIN
core-ssh:~#