ESPHome - Cannot connect to hostname

Hi folks, I’d really appreciate your support here.

Please find bellow my current environment installed in a RPI4b:
Home Assistant 2023.1.2
Supervisor 2023.01.1
Frontend 20230104.0 - latest
HACS: 1.30.1
ESPHome: 2022.12.8

So currently I’m not able to reach out to my ESP hostnames despite they are all online, can ping them and can see a few temperature sensors data in HA.
image

However, whenever I try to see hostname logs get this error…

Hence start following the issue hints, maybe it’s DNS, current DNS configuration within HA is as below…
image

Alhtough when checking through SSH to RPI4 can see diferrent information

xxxx@rksrpi4:~# ha dns info
fallback: true
host: 172.30.32.3
llmnr: false
locals:
- dns://192.168.1.1
mdns: false
servers: []
update_available: false
version: 2022.04.1
version_latest: 2022.04.1

My first question is why host has 172.30.32.3 as IP Address instead of 192.168.1.173 ? Nonetheless, have correct DNS server configured for local name resolution, in this case 192.168.1.1

Now looking into dns log just found out that there’s a different DNS server answering my requests, in this case 172.30.32.1 , that shouldn’t be the case.

xxxx@rksrpi4:~# ha dns log
[INFO] 172.30.32.1:34856 - 51557 "A IN esp32btp102.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000293999s
[INFO] 172.30.32.1:50414 - 14388 "A IN esp32btp001.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000363369s
[INFO] 172.30.32.1:60944 - 52848 "A IN esp32btp101.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.00023737s
[INFO] 172.30.32.1:43920 - 41944 "A IN esp32btp102.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000325221s
[INFO] 172.30.32.1:42975 - 42068 "A IN esp32btp001.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000490535s
[INFO] 172.30.32.1:40795 - 13175 "A IN esp32btp102.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000374628s
[INFO] 172.30.32.1:36662 - 31990 "A IN esp32btp101.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000363776s
[INFO] 172.30.32.1:54005 - 62504 "A IN esp32btp001.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.000441368s
[INFO] 172.30.32.1:57036 - 39839 "A IN esp32btp101.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.00048559s
[INFO] 172.30.32.1:39890 - 61011 "A IN esp32btp102.local.local.hass.io. udp 49 false 512" NXDOMAIN qr,aa,rd 49 0.00042472s

Those are my three ESP (active) hostnames that ESPHome cannot reach.

Any thoughts or ideas that help me resolve this matter would be great.

1 Like

Hi,
I have seen this kind of thing myself before & in my case it came down to esphome not being able to find the devices because they were in a different network to the HA box. Because i have a separate ip network for all my iot devices i needed to install an mDNS service to allow for dns broadcasting between the networks.
Is your HA/esphome machine in a different network to these other devices?
Cheers
Nick

Have you found a solution yet? I’ve got exactly the same issue…

Not yet, currently considering moving HA into same esphome vlan, despite default vlan and IoT vlan can freely reach with each other.

Honestly don’t understand why is not working…

These are mDNS issues, and i doubt that any .local address resolves properly.

My solution. use your routers DNS:
1- Configure your network domain name in your router, f.e. assistant.url

2- Make a DHCP reservation for your device and name it “my-esp”
3- add your domain name to ESPhome wifi settings

esphome:
  name: my-esp

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_iotpw
  domain: .assistant.url

and behold…my-esp.assistant.url resolves in DNS…tadaaa