I read somewhere on the boards that HA have a fallback for DNS and there is a bug in this feature, so it does never reset once activated.
AdGuard would probably fail the first few attempts since it is an add-on that is running on HA and therefore it might activate this bugged feature.
This isn’t true anymore. It only goes to the fallback if the DNS server provided via DHCP or in static config and any other added DNS servers fail to return an answer.
.local seems to be controlled by another name lookup service, maybe mDNS and the priority of the name lookup service and how they interact can be the reason for the .local issues.
I do not know if .lan is also controlled by other services.
It’s not. There’s a list of special use TLDs, you can find that list here. .local is one, .lan is not.
In addition I should note that single name hostnames without a TLD (like homeassistant or my-pc for example) are expected to be resolved via LLMNR. Or via a hosts file lookup on a local machine. They are also not expected to go to a DNS resolver either.
I remember there was a proposal to reserve a few TLDs for LAN-only use like .lan, .internal, .home, etc. I’m failing to find it now. But anything other then those ones wikipedia lists as special-use work normally (all systems including HA ask the configured DNS server for an answer).
I use .lan personally. I’ve also used .home in the past and seen others use .home.arpa around here. Can kind of take your pick from any that aren’t reserved for special use like .local.
I can confirm that DNS query like nslookup myhost.mydomain.lan are still not resolved under HA OS with error NXDOMAIN, despite my custom rules in AdGuard. No entry about these queries appear in AdGuard log.
I assume 192.168.1.2 is the IP of the ha machine, if so that makes sense. Any issues in ha resolution info? Also just to check, if you do nslookup myhost.mydomain.lan 192.168.1.2 and specifically query the machine running Adguard you get the answer you want right?
Yes, 192.168.1.2 is the ip address of my raspberry pi with HA OS and AdGuard addon. There is something special with the .lan TLD in HA OS. In other OS (e.g. Windows on other machines) or with other TLD is fine.
That being said I am noticing that I actually can’t get homeassistant.lan to resolve from anywhere in my network which is odd. I don’t really use that one since I have a different internal url for HA with an SSL cert. Kind of odd since it should work, maybe something strange with that one.
The resolution issue is not only for homeassistant.lan and is only in HA OS, not in other machines.
Tried to define my hosts in AdGuard both in DNS rewrite and custom rules.
Ok I mean I’m not really sure how to explain what you’re seeing. I’m actually mdegat01 on GitHub. If you look at supervisors DNS plugin you’ll see most of the recent commits are by me. You’re welcome to review the code but I can assure you there’s nothing in there about .lan. And in addition im showing you .lan queries working on my HAOS system.
So I can help you debug but there is no special handling around .lan in an HAOS system. There is something going on in your setup.
Well I mean Adguard will let you make a DNS rewrite rule for basically anything you want. But the challenging part is will machines actually send those queries to it? HAOS for example won’t send .local queries to Adguard or any other resolver. Neither will any Linux system that relies on systemd-resolved. But other systems and resolvers might.