[Fix] Unable to Resolve .local Domains in Linux (Fedora/RHEL)
I have a home lab that uses the domain name of "home.local".
Recently, I tried to access a system from my Fedora linux laptop and was presented with the error "Can't find that address".
Odd, that should work, it's in DNS. Let's dig it to find out.
I fire up dig, try to resolve my FQDN of host1.home.local, and it fails.
What?! How can this be? So I try dig host1.home.local @
So, the DNS server I am pointed to doesn't know about my home.local domain, no problem, I'll just fire up the network config and set that. Ok done, statically defined the DNS ip and restarted networking.
I tried to dig my host1.home.local again, but it still fails. What the heck is going on?
So I run dig without any arguments, and discover my first piece of interest. It's resolving from 127.0.0.53. A loop-back address that systemd creates as part of the systemd-resolved service.
So this local-DNS resolver can resolve all of my other hostnames, just not anything in home.local, what gives?
It turns out, the .local domain isn't recommended to use in home/lab scenarios anymore (was it ever? I thought it was 10+ years ago when I setup my first home lab.).
Ok, so it's not recommended, but that doesn't mean it should stop resolving using this new systemd-resolved service, right?
Right, but systemd-resolved "hi-jacks" requests to the .local domain, and does not forward this request to the upstream DNS server.
Read more about that here: https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html
What is the Solution?
Edit the /etc/systemd/resolved.conf file, comment out Domains= and include your domain after the equals sign.
Write and save this file, then restart networking or reboot and DNS resolution to your .local domains (that you specified in the resolved.conf file) will magically resolve again in Fedora/RHEL or any other linux distro that uses systemd-resolved.