DNS lookup

Any place I have to provide an IP address in a device definition I should be able to supply a name instead so wiz_232423.home.zzz rather than 172.20.22.123. It would also be nice to hubitat.home.zzz to find the habitat page.

image

vs

image

I'm really confused by this. Because I do access both my hubs using their FQDN and not their IP address. Why are you unable to do so?

Here is what I do. Use a router that supports DNS-over-TLS (DOT). You don't want to Encrypt end to end with DNS. This makes it very difficult to troubleshoot or see some is going somewhere they shouldn't be. Encrypted to Router the router will take the request encrypt it to your list of DNS servers that you want the support the DNS Encryption. This would be the best and optimal implementation for this type of solution.
image

All DNS Requests that are handled by the Router are encrypted. Thus, you don't need FQDN only an IP of the router (or internal DNS server that can proxy this).

From a networking, security, and performance standpoint this should cover it.

First, using hubitat with a local FQDN - good question. At the moment Unifi isn't even showing it by IP address. But hubitat.local is working (mDNS).

As to DNS over HTTP. That doesn't help in providing the IP address for existing devices. Also, I'm looking up local addresses, not public addresses so Google's support for DNS Over HTTP doesn't help.

a function in netutils would be nice..

String DnsLookup(String name,number timeout = 10,boolean list =false)

if list returns a list of addresss
otherwises returns a single address and if more than one returns the first.

if fails or timesout returns null

2 Likes

I'm confused about what you are trying to accomplish. If you are looking at local resolution you can modify your DNS entries on some routers (and some cases if statically assign in DHCP) to resolve for different hubs (hubitat, Hubitat2, whatever) or other devices (Bond, Hub LiteFy, Smartthings, whatever you need).

What are you trying to do?
Are you using your router for DNS Proxy or local DNS Server?

I think he was very clear in what he was trying to do in the post below. This would be a hubitat app/driver/infrastructure change, not a DNS server issue per se (although if the assets aren't in his local DNS that would obviously be another separate issue he would have to resolve):

1 Like

Yes, I don't want my mention of getting hubitat.home.zzz to get confused with the primary goal of being able to use names instead of IP addresses for devices.

I also tried to unravel what exactly issue OP was facingā€¦(DNS lookup - #34 by djw1191)

So what about non-http HubAction calls? For example, OP appears to be using a Wiz driver that utilized UDP. Does destinationAddress look like itā€™ll support a domain name as well? You specifically call out HTTP in your edit, so just wondering if your edit is universal for all HubAction protocols.

I stand by the stance that a discrete DNS function seems unnecessary if network based calls support implicit DNS lookups when a domain is providedā€¦ I at least canā€™t think of a use case of needing to do a standalone DNS call.

if .. implicit lookup is not supported and I need to use UDP

Just an FYI - the reason I didn't see habitat listed was that I'd restricted myself to wireless devices so didn't see the wired one. Again, being able to find by hostname is secondary to using names for devices.

This morning I'm greeted by my wife telling me that the lights don't work. It turns out that the IP addresses for Wiz had changed. Why? I have no idea since normally the addresses are stable. No big deal since they each registered a DNS name via DHCP.

Except for Hubitat which insists on using IP addresses. I have over 300 IP devices in use. Managing this manually does not scale which is why DHCP and DHS were invented.

So my current plan is to minimize any dependency on Hubitat and go to local devices with open APIs such as Shelly and Tasmota.

Fortunately, I wrote my own app to automatically update the IP addresses for the Wiz bulbs (thank you @zranger1) but, even there, I may finish my own local support for the wiz protocol.

I'd prefer to save time and use Hubitat but without support for using the DNS names rather than IP addresses, I have to find alternatives.

Good question. Did you have DHCP reservations for those IP addresses?

They are all available in my local DNS via their DHCP reservations. But it doesn't matter why the address changed, what matters is that for some reason Hubitat is exceptional in not using the names.

image

If you have used your UniFi network (based on screen image posted above) to actually RESERVE an IP address for each device on your home network, then the IP address of those devices would not change. At least, none of my devices have ever changed their DHCP Fixed IP addresses when my UniFi Dream Machine assigns them. If you have not gone into each device within the UniFi Network App and checked the "Use Fixed IP" option, then your devices will change IP addresses over time.

As for Hubitat not updating the DHCP/DNS Server with a node name, I agree that it would be nice if it did. The hub does respond to the mDNS name of "Hubitat.local".

1 Like

You want me to manage 300 addresses by hand? That's a nonstarter.

How about just 1 then... The Hubitat hub?

Alas, the hub is one of the few devices I have assigned a fixed address because, for some reason, it doesn't use option 12 to register its name.

I went back and re-read your latest few posts. The following is what I somehow fixated on, not the real issue at hand.

I think I now fully understand your frustration... It is not so much that the Hubitat Hub changed its IP address, or that it does not update the DNS record with its node name...

The real issue is back to the original topic of this thread. Because Hubitat does not easily allow for Fully Qualified Domain Names to be used instead of TCP/IP Addresses, when any of your 300 other devices change their IP addresses, Hubitat is no longer pointing to the correct device on the network. I can definitely understand your frustration with this. I am amazed that it worked so well for a year without devices on your home network changing IP addresses.

Personally, I would just click the "Use Fixed IP address" on each device and call it a day. It is a one-time effort, and it resolves this issue forever. I have most of my ~100 home network devices configured this way, as I prefer they never change their IP addresses. It is just one less variable to worry about. I have worked in manufacturing plants for over 30 years, and we always assign static IP addresses on all factory floor devices. Our end-user desktops/laptops all use DHCP for simplicity. So, I am accustomed to this design/approach. I set it and then forget it. YMMV, of course.

3 Likes

I donā€™t know why I canā€™t help myself but respond to this thread every couple of months, but here I amā€¦

This statement isnā€™t entirely accurate. Per staff, HubAction does do implicit DNS lookups when doing an HTTP call (see link below). There is an outstanding question of whether the same is true for plain TCP or UDP requests done via a HubAction call, as is used in the whiz driver being used by OP. But it really isnā€™t a fact that a FQDN canā€™t be used or that the hub doesnā€™t support DNS for network requests.

4 Likes