Next generation DNS resolve scheme.
-
IPv4
- 208.67.222.222
- 8.8.4.4
-
IPv6
- 2001:4860:4860::8888
- 2620:119:53::53
resolvectl status
Tip: With systemd-resolved.service, 127.0.0.53#53(127.0.0.53) is the local DNS server for resolving.
sudo vim /etc/systemd/resolved.conf
In [Resolve] section, modify the DNS ip:
[Resolve]
DNS=208.67.220.220 208.67.222.222
sudo vim /etc/systemd/resolved.conf
In [Resolve] section, modify the Domains:
[Resolve]
Domains=~. ~github.com ~microsoft.com
In Domains field, Specify which domain you want to reolve prefix with ~
.
⚠️ ~.
means resolve the root DNS(.), but there are usually two~.
value of different items shown byresolvectl status
. One is Golbal, another is Link which is dynamic set by receiving over DHCP, information provided via NetworkManager.
💩 Usually, Link [NUM] interface (generated by DHCP, local dns) is faster than Global, so software prefer to use it because both have
~.
value in Domains field. That's why Global need to speficy Domains value in/etc/systemd/resolved.conf
file.
systemctl restart systemd-resolved.service
Its DNS configuration is from NetworkManager, for example:
Link 3 (wlp3s0)
Current Scopes: DNS LLMNR/IPv4 LLMNR/IPv6
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 208.67.222.222
DNS Servers: 1.1.1.1 208.67.222.222 208.67.220.220
DNS Domain: ~.
NetworkManager Configure file:
Previous:
cd /etc/sysconfig/network-scripts/ #Location
man nm-settings-ifcfg-rh #Reference
Present:
cd /etc/NetworkManager/system-connections/ #Location
man nm-settings #Reference
Custom DNS ip and abandon ISP DNS ip
dns=1.1.1.1;208.67.222.222;208.67.220.220; #semicolon(;)
ignore-auto-dns=true
⚠️ Use semicolon(;) to split multiple DNS ip, if any.
systemctl restart NetworkManager.service