ubuntu:networking:dns:configure_dns
This is an old revision of the document!
Table of Contents
Ubuntu - Networking - DNS - Configure DNS
ALERT: There are multiple areas where DNS can be set.
It is recommended to only set them in one place, as if set in multiple places then all these DNS resolvers may be used which can result in additional work and confusion when viewing logs.
Using Netplan
Set the DNS
- /etc/netplan/01-network-manager-all.yaml
... [DEVICE_NAME]: ... nameservers: addresses: [1.1.1.1, 9.9.9.9]
NOTE: The filename under /etc/netplan might be different.
Using Global DNS Setting
Set the DNS
- /etc/systemd/resolved.conf
[Resolve] DNS=9.9.9.9 FallbackDNS=149.112.112.112 DNSSEC=true DNSOverTLS=opportunistic
NOTE: This sets both DNSSEC and DNSOverTLS too.
Restart systemd
sudo systemctl restart systemd-resolved.service
Check status
systemd-resolve --status
returns:
Global DNS Servers: 9.9.9.9 Link 3 [DEVICE_NAME] DNSSEC Setting: yes DNSSEC Supported: yes DNS Servers: 8.26.56.26 8.20.247.20
ubuntu/networking/dns/configure_dns.1610537377.txt.gz · Last modified: 2021/01/13 11:29 by peter