companion icon indicating copy to clipboard operation
companion copied to clipboard

DNS entries for Target IPs

Open sbtv-ltd opened this issue 4 years ago • 8 comments

Describe the feature

Instead of exact IP addresses, would it be possible to use a DNS entry for when the IP address is likely to change or is connected over a WAN.

Usecases

We use a Blackmagic Atem to generate a MV feed for a remote producer off-site, we can port forward across our networks and would like the producer to be able to connect using our Domain Name to change feeds in this multiviewer.

sbtv-ltd avatar Jan 13 '21 20:01 sbtv-ltd

it deppends on the module, so it would have to be changed on a module by module basis. if there is any exact module you need it please post it on the module. I can't see right now how it would be a problem, but there might be some object that needs specific IP's in the field. but I don't think so, at least not on something that uses the IP-protocol.

McHauge avatar Jan 13 '21 20:01 McHauge

The field is regex to IP to reduce user error. @Julusian could we modify to regex for IP or valid domain structure?

josephdadams avatar Jan 13 '21 23:01 josephdadams

I think this should be done as a new regex and be an opt in for modules. (perhaps as a transition period, until all the modules can be checked and updated?)

We need to be careful here to not introduce performance issues, as node does not do any dns caching, which could cause a noticable performance hit for some modules depending on how the os does caching. For any which open a tcp connection and keep it open, there should be no noticable impact, but anything http will try to resolve the domain for every request, and udp/osc may for every packet.

I ran some quick tests at home, and on mac and some linux machines there does not appear to be any os cahcing, so running the dig command queries my router and gets a response in 1-4ms. I dont know how to check on windows, but it will likely be the same. This will of course vary depending on the quality of the router, and its caching.

For some modules (atem) it would be best for the module to explicitly handle the lookup before connecting, and to cache the result until the connection dies. If it were to change mid-connection, it would cause the connection to die in a similar way.

Julusian avatar Jan 14 '21 00:01 Julusian

Also Just found a use case for this with MQTT Generic, where the broker IP would be a server DNS not an IP address.

sbtv-ltd avatar Feb 06 '21 11:02 sbtv-ltd

Just adding my vote for a REGEX_IP_OR_HOSTNAME, and maybe also REGEX_HOSTNAME, option.

sphlabs avatar Mar 09 '21 10:03 sphlabs

REGEX_HOSTNAME is added. A REGEX_IP_OR_HOSTNAME would be overly complex and would become tough to decide what constitutes an IP that's invalid but could be a valid hostname.

krocheck avatar Feb 24 '22 18:02 krocheck

Adding my vote to include this option, I routinely move machines to different networks and being able to access them by [hostname].local rather then IP would be helpful. I would use this on generic MQTT and generic OSC if the option existed.

natedreger avatar Feb 28 '22 14:02 natedreger

Adding a vote here for DNS names too. I'm using Philips Wiz lights, which have the potential to be reassigned a new IP each time they are powered on/off. This hard limit on RegEX seems like overkill, why not just add a warning that this isn't a valid IP?

seanmcnally98 avatar Aug 14 '22 02:08 seanmcnally98