My devices are not visible from the outside world, and those that get locally addresses assigned by my Ubuiqit DHCP server acting as my local DNS. Why doesn’t HA honor the DNS server supplied by DHCP?
Home assistant itself is properly listed in my /etc/hosts file, so it is otherwise cooperating.
I did attempt to set up DNS IP, but it doesn’t let me specify the DNS server by IP address. And with over 300 devices I’m using static addresses is not an option.
Not sure how to do “ha resolution info” remotely but at the console it is just say “working” with no details.
And DNS IP failed and goes back to openDNS when I try to add it.
And to add injury to insult for some reason my mosquito machine’s IP address changed on a reboot (first in months) and the MQTT broker won’t accept the updated address.
Yes, I’m typing the IP address because Ubiquiti isn’t giving me a DNS entry for it. If I find a name I’ll switch to using it. But I’m surprised it seems to be rejecting the IP address.
OK I understand that you are using the DNS IP integration now.
But that does not affect system dns resolution, it provides a sensor that looks up the IP address of a hostname and the state of that sensor is the IP address. The DNS IP integration can use whichever DNS resolver you choose.
However in the example you have given, you are not asking it to resolve a hostname (eg www.example.com), you have asked it to resolve an IP address (172.20.0.1), which doesn’t really make sense.
DNS servers can never be hostnames.
It will have to be IP addresses.
A DNS server translate hostnames into IP addresses and the IP addresses are then contacted.
Computers can not use hostnames to communicate, so a hostname in a DNS setup would require the computer to lookup the IP address that belongs to the hostname, which means contacting a DNS server. It’s a catch 22
In your query that you have posted a picture you have entered an IP address in the hostname field.
You need to enter a hostname there to make the query work.
Again oops. So it seems DNS IP is used to look up a name for testing and not for setting the DNS for HA. In fact, it says that I am using the correct resolver at 172.20.0.1 already.
Which brings me back to why can’t I use a local DNS name for my MQTT broker. DNS IP distracted me into assuming it was using an external DNS resolve. But given that it’s using the correct local address
I’m using the Ubiquiti DHCP server as my DNS server. aaz.lt does have a public presence but my local machine is just in the local DHCP table. I’m not sure how authoritative figures in to simple asking for resolution. nslookup and ping work fine on my local machine.
I tried to figure out how to SSH and installed SSH/Telnet support but failed. I can, however, type on the console but it says no nslookup and I can’t find an equivalent.
BTW, I figured out why the IP address seemed to change – I had WI-FI enabled so there were two addresses. But now I can’t revert to the wired address even though I can ssh into the machine running mosquito. So if I turn off Wi-Fi it becomes in accessible. One big reason for using a name is that I can then use either Wi-FI or wired.
No you can’t.
A hostname can only point to one IP address and wired and WiFi will have different IP addresses, because the netcard will have different MAC addresses.
I know that each has a separate IP address. That’s why I saw the address change.
But if I use a name and only one interface is registered, it should switch to that name. Of course, I say should DHCP cannot be relied on to clear stale entries, but I can work around that. What is important is that by using names, I only have to address this issue in one place rather than the many places where there can be a reference.
You will have to update the DNS server with every change, since you should not be able to register the same name to two MAC addresses/IP addresses.
You will also have to fight with DNS clients that cache the lookups they have done earlier, which can be handled by lower the TTL of the zonefile and the host entry.
DHCP is updated automatically, though, as I noted, it means I only have to deal with one
place. I’m well aware of the limits of DHCP as DNS. I set my TTL to 900 seconds (15 minutes).
I don’t think of DHCP as a zone file as such – I do have my public zone files which are proper DNS zone files.
DHCP servers are not DNS servers, but they can be linked. dnsmasq is a good and used often in home lans.
A hostname can have more than one IP via DNS, that is how round-robbining works. It means the load for a hostname can be spread over more than one host. Try , eg, www.bbc.com. I set up the DNS IP integration for it yesterday and it changes often