Support hostnames in UDP component as well as IP addresses #3220
Unanswered
Spamfast
asked this question in
Component enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Component name
udp
Link to component documentation on our website
https://esphome.io/components/udp.html
Describe the enhancement
At present, the
addresses
key on theudp
component accepts only dotted-quad IP addresses. It would be useful if it could accept an FQDN - or if the underlying stack honours DHCP option 119 an unqualified hostname.Other components (if there are any) that talk to remote network devices could leverage the infrastructure put into place to implement this.
Use cases
I have a generic domain name
syslog.lan
on my network which points to the appropriate syslog server given who is making the DNS request. For connecting my ESPHome devices to my syslog infrastructure, it would be more manageable if I could use this instead of having to hard-code an address into the YAML and binary or resort to on_boot lambdas hacking into the component configuration.It would also allow packet transport senders to identify their receivers by DNS name rather than hard-coded addresses which could change if reserved DHCP assigned after a network reconfiguration.
Anything else?
I know that the
getaddrinfo()
API works from lambdas on both thearduino
&esp-idf
frameworks for theesp32
platform so the base facility is available for these at least. Initial lookups could be triggered by wifi or ethernet interface bring up (i.e. upon address & DNS server discovery) and re-queried if the connection is lost and re-establsihed.Given that mDNS is also a preferred lookup mechanism for ESPHome, then
.local
names should probably be supported via mDNS as well.Beta Was this translation helpful? Give feedback.
All reactions