DNS problem with .local Domains

Aug. 9, 2019    Tags: admin  systemd  resolved  dns


Some days ago I had the problem at different hosts to access some .local domains. One Notebook was setup with wicd and systemd-resolved and the second one used just the NetworkManager.

If I tried to resolve it via the normal systemd-resolve I got the following error:

[email protected]:~# systemd-resolve MYDOMAIN.local
MYDOMAIN.local: resolve call failed: No appropriate name servers or networks for name found

These `.local` Domains are all "blocked" by default. One possible solution is to enable the Domain you want via systemd-resolve configuration.


Adapt configuration file

I added the following things to `/etc/systemd/resolved.conf`:

[email protected]:~# cat /etc/systemd/resolved.conf | grep -v '#'


I also had to adapt my `/etc/nsswitch.conf`:

# change hosts entry to:
hosts:  files mdns4_minimal [NOTFOUND=return] dns

If we restart our systemd-resolve process: `systemctl restart systemd-resolve` the resolve itself should work:

[email protected]:~# systemd-resolve MYDOMAIN.local

-- Information acquired via protocol DNS in 3.8ms.
-- Data is authenticated: no


You should also see your `MYDOMAIN.local` in the output of `systemd-resolve --status`.


Setup for network-manager

If you have the NetworkManager enabled the setup is somehow different.

setup systemd-resolve for NetworkManager

NetworkManager should use per default our systemd-resolve for dns lookups. If not you can specify it in its config file:



Setup dhcp

And don't forget the dhcp.

In `/etc/dhcp/dhclient.conf` we have to setup the following:

prepend domain-name "MYDOMAIN.local ";

Be aware of the trailing whitespace which is needed. Otherwise it will not work. After these changes restart NetworkManager: `systemctl restart NetworkManager`.

[Photo by Dmitry Ratushny on Unsplash]