0

I have a local DNS server to resolve names on my LAN, but systemd-resolved only uses it for a few minutes before switching to a different DNS server.

/var/log/syslog
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Transaction 29195 for <feeds.propublica.org IN AAAA> scope dns on wlp2s0/*.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Using feature level UDP+EDNS0 for transaction 29195.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Using DNS server 192.168.1.250 for transaction 29195.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Sending query packet with id 29195.
...
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Timeout reached on transaction 29195.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Retrying transaction 29195.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Switching to DNS server 192.168.1.1 for interface wlp2s0.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Cache miss for feeds.propublica.org IN AAAA
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Transaction 29195 for <feeds.propublica.org IN AAAA> scope dns on wlp2s0/*.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Using feature level UDP+EDNS0 for transaction 29195.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Using DNS server 192.168.1.1 for transaction 29195.
Mar 11 16:38:06 allen-dell systemd-resolved[20854]: Sending query packet with id 29195.

Is there a way to tell systemd-resolved to not switch?


update

I had tried to make 192.168.1.250 the only NS, but it seems like the dhcp in my router (D-Link DIR-860L) is explicitly adding its gateway to the lease (because I have not specified it manually).

systemd-resolve --status
Link 3 (wlp2s0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.1.250
                      192.168.1.1
          DNS Domain: ~.
                      local

dhclient-XXX-wlp2s0.lease
lease {
...
  option domain-name-servers 192.168.1.250,192.168.1.1;
  • Usually, there is a reason for systemd-resolvd to switch to a different DNS-Server. In your log it looks like the reason is a timeout from the DNS-Server at 192.168.1.250. Did you test that DNS server with a tool like dig or nslookup to see if it works and can provide an ipv6 address? nslookup -type=any feeds.propublica.org 192.168.1.250or dig @192.168.1.250 feeds.propublica.org ANY would be a start. – bey0nd Mar 12 at 7:24
  • That DNS server does work when I query it directly, so I'm fairly confident it's not a bind problem. I'm very new to systemd-resolved so I just need to figure out how to get it to "prefer" my DNS whenever possible. – Allen Mar 12 at 15:37
0

I think what you're looking for is /etc/systemd/resolved.conf, but it might not prevent it from also accepting the on proposed by the DHCP-Server.

| improve this answer | |

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.