Configures Cloudflare DNS (1.1.1.1 / 1.0.0.1) with encrypted DNS-over-TLS, fully replacing ISP-provided DNS using native systemd tooling.
Applies to: systems running systemd-networkd + systemd-resolved
Does not apply to: NetworkManager setups
ps aux | grep -E "NetworkManager|systemd-networkd|dhcpcd"Expected output includes systemd-networkd. If NetworkManager appears instead, this guide does not apply.
systemctl status systemd-resolved
# If inactive:
sudo systemctl enable --now systemd-resolvedLocate your network config:
ls /etc/systemd/network/Edit the relevant file (e.g. 20-ethernet.network):
sudo nano /etc/systemd/network/20-ethernet.network[Match]
Name=en*
Name=eth*
[Link]
RequiredForOnline=routable
[Network]
DHCP=yes
MulticastDNS=yes
DNS=1.1.1.1
DNS=1.0.0.1
[DHCPv4]
RouteMetric=100
UseDNS=no
[IPv6AcceptRA]
RouteMetric=100
UseDNS=noUseDNS=no prevents DHCP from injecting ISP DNS servers.
sudo mkdir -p /etc/systemd/resolved.conf.d
sudo nano /etc/systemd/resolved.conf.d/cloudflare.conf[Resolve]
DNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com
FallbackDNS=2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
DNSOverTLS=yes
DNSSEC=noThe #cloudflare-dns.com suffix enables TLS certificate verification. Without it, connections may fall back to opportunistic (unverified) mode.
ls -l /etc/resolv.confMust point to /run/systemd/resolve/stub-resolv.conf. If not:
sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.confsudo systemctl restart systemd-networkd systemd-resolvedresolvectl statusGlobal section should show:
DNS Servers: 1.1.1.1#cloudflare-dns.com
1.0.0.1#cloudflare-dns.com
DNSOverTLS: yes
Interface section should show only Cloudflare IPs — no ISP addresses (e.g. 103.x.x.x).
Append to /etc/systemd/resolved.conf.d/cloudflare.conf:
LLMNR=no
MulticastDNS=noThen restart: sudo systemctl restart systemd-resolved
This setup provides:
- Cloudflare DNS exclusively
- Encrypted DNS queries via DNS-over-TLS
- No ISP DNS leakage
This setup does not:
- Change your public IP
- Route traffic through Cloudflare
- Act as a VPN or bypass ISP throttling