Problems with Local DNS Resolution

Modern versions of Linux Mint, and likely others using systemd, can have issues with local DNS resolution. For me it appears as the system not resolving local DNS from my Pi-hole server.

It seems complicated and many solutions have been floated for solving it:

  • Editing nsswitch.conf
  • Editing NetworkManager.conf
  • Disabling various services

The single solution that has worked for me every time is replacing /etc/resolv.conf, or rather symlinking it to a different configuration file that already exists and is auto-generated.

rm /etc/resolv.conf

ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

This maybe breaks DNSSEC resolution because it removes the option “options edns0 trust-ad”, so do your homework if that concerns you.

Restoring it to the previous configuration is as simple as:

rm /etc/resolv.conf

ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Leave a comment