Changing DNS servers on Linux improves name resolution reliability, privacy, and performance when accessing internal services or public sites. Using trusted resolvers such as enterprise-provided servers or well-known public resolvers avoids outages caused by flaky default infrastructure and can bypass slow or misconfigured upstream providers.
On modern systemd-based distributions, systemd-resolved typically manages resolver settings and exposes them to applications through a stub listener and the /etc/resolv.conf file. The main configuration lives in /etc/systemd/resolved.conf, and this file controls which upstream DNS servers the resolver forwards queries to, along with optional fallback servers.
Some environments instead delegate DNS configuration to NetworkManager, VPN clients, or container runtimes, which can override settings at the interface level. Misconfiguring the resolver does not usually disconnect network links but can prevent domain names from resolving; keeping a backup of the original configuration and having IP-based access to critical systems greatly reduces risk when changing settings.
$ whoami root
$ systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-01-10 12:09:15 +08; 17h ago
Docs: man:systemd-resolved.service(8)
##### snipped #####
An Active: active (running) line indicates that systemd-resolved is currently handling resolver duties.
$ ls -l /etc/resolv.conf lrwxrwxrwx 1 root root 39 Apr 23 2024 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
A symlink pointing into /run/systemd/resolve usually means this method applies; if it is a plain file, another tool such as NetworkManager or resolvconf may be in control.
$ sudo cp /etc/systemd/resolved.conf /etc/systemd/resolved.conf.backup.$(date +%Y%m%d%H%M%S)
Restoring the backup with sudo cp is the quickest way to undo changes if name resolution fails after modification.
$ sudo nano /etc/systemd/resolved.conf
[Resolve] DNS=192.0.2.53 192.0.2.54 FallbackDNS=192.0.2.54
Multiple IP addresses on a single DNS line are tried in order; FallbackDNS is used when the primary servers are unreachable.
$ sudo systemctl restart systemd-resolved
If a typo produces an invalid configuration, applications may fail to resolve hostnames until the error is corrected or the backup configuration is restored.
$ resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
DNS Servers: 192.0.2.53 192.0.2.54
Fallback DNS Servers: 192.0.2.54
##### snipped #####
The DNS Servers and Fallback DNS Servers lines should list the new IP addresses configured in /etc/systemd/resolved.conf.
$ dig +short api.example.net 203.0.113.50 203.0.113.51
Repeated failures or timeouts suggest connectivity or configuration problems with the chosen resolvers and may require switching to different DNS servers or reverting the backup file.