3

Ubuntu 22.04

Original:

root@ubuntu:~# resolvectl
Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (ens5)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 12.34.56.78
       DNS Servers: 12.34.56.78 12.34.56.79

What I did:

  1. Add nameservers entry in /etc/netplan/01-netcfg.yaml file
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens5:
      dhcp4: yes
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]
netplan apply
  1. Add DNS servers in /etc/systemd/resolved.conf file
[Resolve]
DNS=8.8.8.8 1.1.1.1
FallbackDNS=8.8.4.4
systemctl restart systemd-resolved
systemctl enable systemd-resolved

After rebooting:

root@ubuntu:~# resolvectl
Global
           Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
    resolv.conf mode: stub
  Current DNS Server: 8.8.8.8
         DNS Servers: 8.8.8.8 1.1.1.1
Fallback DNS Servers: 8.8.4.4

Link 2 (ens5)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 8.8.8.8
       DNS Servers: 8.8.8.8 1.1.1.1 12.34.56.78 12.34.56.79

How to remove 12.34.56.78 and 12.34.56.79 in DNS server list?

2
  • are the 12.34.56 servers being passed out by the DHCP server? you are enabling DHCP, but then specifying DNS servers. you can use a dhcp4-overrides with a setting use-dns: false to ignore the dns servers being pushed down via dhcp if you want. Commented May 14, 2022 at 23:38
  • 1
    @Frank Thomas Thanks, it worked!
    – DrInk
    Commented May 15, 2022 at 1:17

0

You must log in to answer this question.

Browse other questions tagged .