I have spent hours trying to understand this to the point, I did a clean install of POP OS 19.10 to see if this resolves the issue, and no it does not.

This seems to work fine on my Mac Book, windows machine and my ubuntu server machine at home, but for some strange reason on my pop os installation internal name resolution only works for about 10 minutes after boot and then stops.

I removed the minimal dns 4 entry in the switch configs... mucked around on resolv.conf to no avail. After about ten minutes it just annoyingly stops working.

I have a mikrotik router, where I set up some static dns entries for my local environment.

The mikrotik hands all three resolver addresses out by DHCP. After digging around I had a look at the results of the systemd-resolve --status cmd and found that occasionally the primary DNS is replaced by the secondary DNS. This seems to result in the internal resolutions to be ignored

Current DNS Server:
DNS Servers:

Appears that the mikrotik DNS lookup times out intermittently causing this issue. Upon timeout systemd-resolved switches to one of the fallback dns entries and never tries the primary again.

Not sure how to solve this one. Any help will be greatly appreciated

  • What did your /etc/resolv.conf show? What has it got now? Why did you change it? What is the IP address of the DNS server? Is your DHCP server giving out the correct DNS server address(es)? – roaima Jan 12 '20 at 9:36
  • /etc/resolv.conf shows the name server I changed it in an attempt to fix the above mentioned issue. It still has the above mentioned ns in it. IP Address is (Mikrotik router) – wickd Jan 13 '20 at 6:22
  • The entry in resolv.conf points to the systemd resolver, which is fine. It in turn has three DNS resolver entries. Did you provide those directly on your PopOS system or is the Mikrotik giving them out? – roaima Jan 13 '20 at 8:58
  • @roaima The mikrotik hands them out – wickd Jan 14 '20 at 12:54

Everything is working as you have defined it. What you're misunderstanding is how DNS resolvers are used to resolve addresses, and so the configuration is not working how you expect.

All three DNS resolver addresses (,, are handed out via DHCP from your Mikrotik router. What this tells each client is that any (responding) resolver is capable of handling any DNS lookup.

When you try to lookup an internal LAN address that only knows how to resolve, theoretically you have just a one in three chance of getting that resolution; the remaining servers will respond with NXDOMAIN.

The specific process of assigning client queries to DNS servers is implementation specific. Some implementations might take the "first" DNS server and prefer using that. Other implementations might take any one of the available set and use that. Other implementations might assign queries on a random or round-robin basis.

The solution here is only to offer as your LAN DNS server, and ensure that it knows how to forward queries upstream if it can't resolve them locally.

How to configure systemd-resolved and systemd-networkd to use local DNS server for resolving local domains and remote DNS server for remote domains may be of assistance with the actual configuration of systemd-resolved.

  • Ok makes sense. Could not understand why this would not work on my linux machine only, but fine on my Windows and Mac machines. So from what I understand I need to change my mikrotik to only issue itself as a primary ns? – wickd Jan 14 '20 at 15:50
  • If you have names/addresses on your LAN to be resolved locally, yes. Absolutely. – roaima Jan 14 '20 at 16:11
  • that works thanks :/ – wickd Jan 14 '20 at 18:16
  • @wickd I've added a reference that may be helpful to you – roaima Jan 16 '20 at 9:59

Is resolv.conf being overwritten?

If POP OS is using systemd-networkd you will need to edit your network's configuration in /etc/systemd/network/*.network and specify static DNS entries.



If POP OS is not using systemd-networkd and DHCPD is overwriting it, you can edit dhcpd.conf and add nohook resolv.conf to keep it from being overwritten.

  • 1
    Hi Yevhen thanks for the response. Have a look at the edit above. – wickd Jan 13 '20 at 6:24
  • 1
    Editing resolv.conf in this configuration is not the proper way to change your DNS servers, as in this setup resolv.conf will continue to be overwritten to point to (the local caching resolver). This loopback address directs requests to the DNS servers specified in /etc/systemd/network/*.network I would advise to edit the mentioned configuration files as per the above template, multiple DNS entries can be put in on separate lines in the same DNS=x.x.x.x format. Following the edits, restart the systemd-networkd service. – Yevhen Stasiv Jan 13 '20 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.