Score:0

How do I have eth0 use the global DNS settings?

cn flag

No matter what I try, eth0 never budges from the DHCP DNS settings.

This is the result I get from sudo resolvectl status --no-pager

Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: yes                 
      DNSSEC setting: yes                 
    DNSSEC supported: yes                 
  Current DNS Server: 1.1.1.1             
         DNS Servers: 1.1.1.1             
                      1.0.0.1             
                      2606:4700:4700::1111
                      2606:4700:4700::1001
          DNS Domain: ~.                  

Link 2 (eth0)
      Current Scopes: DNS        
DefaultRoute setting: yes        
       LLMNR setting: yes        
MulticastDNS setting: no         
  DNSOverTLS setting: yes        
      DNSSEC setting: yes        
    DNSSEC supported: yes        
  Current DNS Server: 192.168.4.1
         DNS Servers: 192.168.4.1

Link 3 (wlan0)
      Current Scopes: none
DefaultRoute setting: no  
       LLMNR setting: yes 
MulticastDNS setting: no  
  DNSOverTLS setting: yes 
      DNSSEC setting: yes 
    DNSSEC supported: yes 

Link 4 (docker0)
      Current Scopes: none
DefaultRoute setting: no  
       LLMNR setting: yes 
MulticastDNS setting: no  
  DNSOverTLS setting: yes 
      DNSSEC setting: yes 
    DNSSEC supported: yes 

Note that eth0 is using 192.168.4.1.

I have tried adding:

[Network]
UseDNS=false
[DHCP]
UseDNS=false
[DHCPv4]
UseDNS=false
[DHCPv6]
UseDNS=false
[IPv6AcceptRA]
UseDNS=false

To /etc/systemd/network/eth0.network, /etc/systemd/networkd.conf, /etc/systemd/resolved.conf

I have tried any which combination of the following:

  • sudo resolvectl reset-server-features
  • sudo resolvectl revert eth0
  • sudo systemd-resolve --set-dns=1.1.1.1 --interface=eth0
  • sudo resolvectl dns eth0 1.1.1.1
  • sudo systemctl daemon-reload
  • sudo systemctl restart systemd-networkd
  • sudo systemctl restart systemd-resolved
  • sudo resolvectl flush-caches --no-pager
  • sudo resolvectl status --no-pager
  • sudo systemd-resolve --statistics

Here is the current cat /etc/systemd/resolved.conf

#  This file is part of systemd.
# 
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See resolved.conf(5) for details

[DHCP]
UseDNS=false

[DHCPv4]
UseDNS=false

[DHCPv6]
UseDNS=false

[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#DNSStubListener=yes
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
DNS=1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
DNSSEC=true
DNSOverTLS=true

What am I missing, I've gone through hundreds of tabs and internet searches, and I can't figure it out.

System is Ubuntu 20.10 (GNU/Linux 5.8.0-1029-raspi aarch64

Score:0
cn flag

Seems doing sudo systemctl restart systemd-networkd resets the DNS configuration that can be applied via sudo resolvectl dns eth0 1.1.1.1.

As such, the restarts should be done after configuration FILE changes, and flushes and status checks should be done after API changes.

That said, the best I can get is the following:

Link 2 (eth0)
      Current Scopes: DNS                 
DefaultRoute setting: no                  
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: yes                 
      DNSSEC setting: yes                 
    DNSSEC supported: yes                 
  Current DNS Server: 192.168.4.1         
         DNS Servers: 1.1.1.1             
                      1.0.0.1             
                      2606:4700:4700::1111
                      2606:4700:4700::1001
                      192.168.4.1         
          DNS Domain: ~.      

Which still has the Current DNS Server as the DHCP DNS server.


Was able to get eth0 to update by doing:

sleep 1
sudo ifdown "$interface"
sleep 1
sudo ifup "$interface"
sleep 1
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.