1

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: 154.0.1.10
DNS Servers: 192.168.88.1
             154.0.1.1
             154.0.1.10

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

wickd
  • 113
  • 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)? – Chris Davies Jan 12 '20 at 09:36
  • /etc/resolv.conf shows the name server 127.0.0.53. I changed it in an attempt to fix the above mentioned issue. It still has the above mentioned ns in it. IP Address is 192.168.88.1 (Mikrotik router) – wickd Jan 13 '20 at 06: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? – Chris Davies Jan 13 '20 at 08:58
  • @roaima The mikrotik hands them out – wickd Jan 14 '20 at 12:54

2 Answers2

3

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 (192.168.88.1, 154.0.1.1, 154.0.1.10) 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 192.168.88.1 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 192.168.88.1 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.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
0

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.

  [Match]
  Name=eth0

  [Network]
  DHCP=yes
  DNS=1.1.1.1

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 06: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 127.0.0.53 (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 08:28