Description
RFC 6762 Multicast DNS - Section 10:
As a general rule, the recommended TTL value for Multicast DNS
resource records with a host name as the resource record's name
(e.g., A, AAAA, HINFO) or a host name contained within the resource
record's rdata (e.g., SRV, reverse mapping PTR record) SHOULD be 120
seconds.
The recommended TTL value for other Multicast DNS resource records is
75 minutes.
ESP8266mDNS's readme states you can pass a TTL value through the begin() method, but I don't see support for this in the source code. Through experimentation I've seen other mDNS devices on my network, like mac computers, have reasonable hostname TTLs and are responsive to access after an initial lookup, but esp8266/arduino devices are not - my computers seem to wait several seconds on an mDNS discovery query for every connection. This makes me think something is going wrong and the ESP8266mDNS library is failing to communicate a sensible TTL.
Anyone have a clue where this is going wrong? Something seems severely broken here.
To reproduce:
- create a simple web server with an mDNS hostname
- use curl to load a static resource from it repeatedly, using the mDNS hostname - make a note of how long each attempt takes
- repeat the experiment using an IP address instead of mDNS hostname.
After the first mDNS query, for the following 300 seconds, mDNS addressed queries should be roughly as fast as IP addressed queries. They are when my test subjects are Mac's, they are not when the test subjects are ESP8266 devices running this arduino core.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.