DNS, MQTT, and ESPHome Issues

I have a project through HA and ESPHome where I have single device doing 2 tasks:

  1. Acting like a BLE Proxy
  2. Forwarding specific BLE advertisements via MQTT

I have my MQTT broker using the internal DNS name “mqtt”. Home Assistant cannot resolve this (more on this later) but the ESPHome device itself has always been able to.

This has worked great until the most recent version of ESPHome was released (2025.10.0). It looks like the ESPHome was changed to:

  • Connect to the MQTT broker during build (fails due to DNS issue).
  • Do some sort of scan for the IP over MQTT.

This is really causing some headaches now since HAOS’s docker setup will not resolve DNS despite having the correct DNS server delivered via DHCP (verified in the settings and “ha dns info” listing my DNS server in both locals: and servers:). While I can use the IP address directly, ESPHome is now - with the new update - trying to get the devices IP address via MQTT!

INFO Successfully compiled program.
INFO Starting looking for IP in topic esphome/discover/sunroom-bt-proxy
INFO Connected to MQTT broker!
INFO Send discover via MQTT broker topic: esphome/ping/sunroom-bt-proxy
ERROR Failed to find IP via MQTT

With all that background, I would like to propose 3 things:

  1. Please fix DNS resolution in HAOS! I would much rather use my DNS then have to hardcode IP addresses in HA!
  2. Make ESPHome discovery fall back to the old [mDNS?] method.
  3. Allow for MQTT to be skipped for discovery.

Q: Where can I find details on what mqtt topics I would need to open up to make the IP scanning work?

1 Like

Home Assistant feature requests go here: home-assistant · Discussions · GitHub

ESPHome feature requests go here: GitHub · Where software is built

ESPHome issues go here: GitHub · Where software is built

2025.10 must have broken something. I have three exp32’s with PZ-004T energy meters outputting to MQTT.
On updating to 2025.10 integration, the mqtt sensors went dark (although the ESP sensors seem to be OK) and updating the ESP32’s through the ESPhome Builder. All three ESP32’s are on fixed IP’s as is the MQTT broker (on HA which runs on X86 bare metal)


========================= [SUCCESS] Took 1.84 seconds =========================
INFO Successfully compiled program.
INFO Host MQTTIP not in cache, will need to resolve
ERROR Error resolving IP address of [‘192.168.0.151’, ‘MQTTIP’]. Is it connected to WiFi?
ERROR (If this error persists, please set a static IP address: WiFi Component - ESPHome - Smart Home Made Simple)
ERROR Timeout resolving IP address: Timeout while resolving IP address for [‘MQTTIP’]
WARNING Failed to upload to [‘192.168.0.151’, ‘MQTTIP’]

I updated the esp32 boards using their web server’s which seems to have worked OK but hasn’t resolved the MQTT issue and ESPhome Builder still returns the OTA upload error above.

This happened while I was trying to migrate to using Tuya smart meters rather than the unidirectional PZ-004T’s as they are bi-directional which added to the confusion!

I’d still like to use the PZ-004T’s in different locations - can anyone guide me to what needs fixing? (suspect it has to do with the OTA platform/password).

esphome:
  name: ctclampincoming
esp8266:
  board: nodemcuv2
###########reset's energy counter to zero if uncommented
#  on_boot:
#    then:
#      - delay: 5s
#      - pzemac.reset_energy: PZEM_1
web_server:
  port: 80
# Enable Home Assistant API
api:
ota:
  - platform: esphome
    password: "xxxxxxxxxxxx"
wifi:
  networks:
  - ssid: "xxxxxxx"
    password: "xxxxxxx"
  - ssid: "xxxxxxxxx"
    password: "xxxxxxxxx"
  manual_ip:
    static_ip: 192.168.0.151
    gateway: 192.168.0.1
    subnet: 255.255.255.0
    dns1: 8.8.8.8
    dns2: 8.8.4.4  

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ctclampincoming Fallback Hotspot"
    password: "xxxxxxx"
captive_portal:
# Enable logging
logger:
  baud_rate: 0
uart:
  - id: ubus1
    tx_pin: GPIO1
    rx_pin: GPIO3
    baud_rate: 9600
    stop_bits: 1
sensor:
  - platform: pzemac
    id: PZEM_1
    voltage:
      name: "Grid Voltage"
    power:
      name: "Grid Power"
      accuracy_decimals: 0
    current:
      name: "Grid Current"
    energy:
      name: "Grid Energy"
    frequency:
      name: "Grid Power Frequency"
    power_factor:
      name: "Grid Power Factor"
    update_interval: 2s
    
    
  - platform: adc
    pin: VCC
    name: "Grid_AC Voltage"
mqtt:
  broker: 192.168.0.91
  username: xxxxxxxx 
  password: xxxxxxxxxx
# Enable logging

No there is no change to ota.

Weird that it can’t find the mqtt broker IP address on your network though:

Check that this has not changed. Can you connect to 192.168.0.151 with MQTT explorer?

There’s a fix in 2025.10.1

[ota] Fix MQTT resolution when static IP appears first in device list esphome#11272 by @bdraco

I found that allowing the ESPHome device’s ACL to freely access the topic esphome (“topic esphome/#”) allowed the existing device to see and respond to the discovery request during the build/install process.

Thankfully, after entering in the static IP address for the MQTT server (skipping DNS) and the above ACL change, I was able to push an update again!

I still think something needs to be done about Home Assistant OS not honoring DNS lookups though.