Skip to content

LEAmDNS: announce IPv6 addresses (AAAA) and use the IPv6 transport - #9330

Open
randybb wants to merge 1 commit into
esp8266:masterfrom
randybb:mdns-ipv6-aaaa-master
Open

randybb wants to merge 1 commit into
esp8266:masterfrom
randybb:mdns-ipv6-aaaa-master

Conversation

@randybb

@randybb randybb commented Oct 13, 2026

Copy link
Copy Markdown

With LWIP_IPV6 the responder only ever answered over IPv4 and never announced
AAAA records, so <host>.local could not be resolved to an IPv6 address.

  • Answer AAAA (and ANY) questions with one record per valid IPv6 address of
    the interface; add them next to the A record in answers, additional records
    and announcements.
  • Re-announce when the IPv6 address count changes (SLAAC usually completes
    after DHCPv4).
  • Join ff02::fb, listen dual stack and send every multicast message to both
    224.0.0.251 and ff02::fb, each only when the interface has an address of
    that family. Without an IPv4 address no A or IPv4 PTR record is written.

The new MDNS_IP6_RESPONDER (on with LWIP_IPV6) covers the responder only;
the unfinished MDNS_IP6_SUPPORT query side stays off.

Tested with ESPHome on 8 ESP8266 devices (core 3.1.2 + this patch) on a
dual-stack network for several days, and on one device with this branch
(master): avahi-resolve -6 -n <host>.local returns the IPv6 addresses,
services are announced over IPv6, IPv4 resolution is unchanged.

Partially addresses #9068: the responder (AAAA answers and announcements over
IPv6) works, which covers resolving <host>.local to the device's IPv6
addresses; IPv6 service queries from the ESP side remain disabled.

Thanks @HeMan for the earlier investigation in #9068.

Answer AAAA (and ANY) questions with one record per valid IPv6 address of
the interface, add them next to the A record in answers, additional records
and announcements, and re-announce when the IPv6 address count changes
(SLAAC usually completes after DHCPv4).

Join ff02::fb, listen dual stack and send every multicast message to both
224.0.0.251 and ff02::fb, each only when the interface has an address of
that family. Without an IPv4 address no A or IPv4 PTR record is written.

The new MDNS_IP6_RESPONDER (on with LWIP_IPV6) covers the responder only;
the unfinished MDNS_IP6_SUPPORT query side stays off.

See esp8266#9068
@randybb randybb mentioned this pull request Oct 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant