Hello.
My HaOS doesn’t even try to resolve .local hostnames.
I read the thread. But it seems that what it says is not true, at least in my situation.
My HaOS instance is running in VM on my server.
I am trying to resolve names and at the same time using tcpdump to see what dns requests are coming out of the VM.
When i’m trying to resolve hostname X.local inside HA, no dns requests generating by VM. But if I try to resolve any other name, even “X.local1” - everything works as it should:
12:26:58.647054 IP ha.local.47516 > gw.local.domain: 58518+ [1au] A? np.local1. (38)
12:26:58.647232 IP gw.local.domain > ha.local.47516: 58518 NXDomain 0/6/1 (1030)
There seems to be something inside HaOS that prevents the .local names from working properly. How do I fix it?
UPD:
Figured out that haos only tries to resolve local names through mdns:
12:43:02.476468 IP ha.local.mdns > 224.0.0.251.mdns: 0 A (QM)? np.local. (26)
12:43:02.476676 IP6 fe80::63c:71c9:cf2b:2169.mdns > ff02::fb.mdns: 0 AAAA (QM)? np.local. (26)
12:43:03.583359 IP ha.local.mdns > 224.0.0.251.mdns: 0 A (QM)? np.local. (26)
12:43:03.583488 IP6 fe80::63c:71c9:cf2b:2169.mdns > ff02::fb.mdns: 0 AAAA (QM)? np.local. (26)
Yeah, you should not be using .local for local hosts for this reason. I’ve tried a bunch and finally settled on using .home.arpa as that seems the have the best support and prevents leakage of dns queries to upstream dns servers.
I fixed it by rewriting /etc/resolv.conf in root filesystem image.
But I guess this will have to be repeated for every HaOS update.
OS Version: Home Assistant OS 10.1
Home Assistant Core: 2023.5.2
Home Assistant URL: http://ha.local:8123
Observer URL: http://ha.local:4357
[core-ssh ~]$ ping macbook.local
PING macbook.local (192.168.1.64): 56 data bytes
64 bytes from 192.168.1.64: seq=0 ttl=63 time=1.460 ms
64 bytes from 192.168.1.64: seq=1 ttl=63 time=2.011 ms
As an FYI, I have two HA systems running HAOS 10.5, both running in a QEMU/KVM setup, using static IPs, and from either HAOS root shell or inside the homeassistant docker bash shell I can successfully ping devices across my LAN using xxx.local. Best I recall, I did not have to do anything special to get this to work.