π Leak-Free DNS on Linux Mint 22.2 Cinnamon (SmartDNS + systemd-resolved + NextDNS)
By default, Linux Mint 22.2 Cinnamon uses NetworkManager and your routerβs or ISPβs DNS, which may leak queries in plaintext.
This guide shows how to route all DNS requests through SmartDNS, with NextDNS (DoH3 / DoH2) as the encrypted upstream β while keeping systemd-resolved for caching and stub resolution.
π§© Architecture
Applications β 127.0.0.53:53 (systemd-resolved)
β 127.0.0.1:65353 (SmartDNS)
β NextDNS (DoH3 / DoH2, encrypted)
- systemd-resolved β local stub resolver (
127.0.0.53) - SmartDNS β local cache and resolver (
127.0.0.1:65353) - NextDNS β encrypted upstream resolver
- NetworkManager β DNS disabled and unmanaged
βοΈ Configuration
1οΈβ£ Disable NetworkManager DNS control
Create:
1sudo mkdir -p /etc/NetworkManager/conf.d
2sudo nano /etc/NetworkManager/conf.d/dns.confPaste:
1[main]
2dns=none
3rc-manager=unmanaged
4systemd-resolved=falseRestart NetworkManager:
1sudo systemctl restart NetworkManagerπ‘ Explanation
| Directive | Purpose |
|---|---|
dns=none |
Prevents NetworkManager from managing DNS. It will not modify /etc/resolv.conf or forward DNS to other plugins. |
rc-manager=unmanaged |
Tells NetworkManager not to touch /etc/resolv.conf β no symlinks, no updates from DHCP or VPN. |
systemd-resolved=false |
Stops NetworkManager from pushing per-connection DNS information to systemd-resolved. Youβll manage it manually. |
Together, these settings disable NetworkManagerβs internal DNS management and hand full DNS control to systemd-resolved and SmartDNS.
This ensures no unwanted DNS overrides or leaks from DHCP and provides a stable, predictable DNS setup even when switching networks.
π Note:
The directivedns=nonealready impliesrc-manager=unmanaged, meaning NetworkManager will not modify/etc/resolv.conf.
Itβs included here explicitly for clarity and to ensure consistent behavior across distributions like Linux Mint.
2οΈβ£ Point systemd-resolved to SmartDNS
Create a drop-in:
1sudo mkdir -p /etc/systemd/resolved.conf.d
2sudo nano /etc/systemd/resolved.conf.d/smartdns.confContents:
1[Resolve]
2DNS=127.0.0.1:65353
3FallbackDNS=
4DNSStubListener=yesπ‘ Explanation
| Directive | Purpose |
|---|---|
DNS=127.0.0.1:65353 |
Forwards all DNS requests from systemd-resolved to SmartDNS. |
FallbackDNS= |
Overrides systemd-resolvedβs built-in default fallback list (1.1.1.1, 8.8.8.8, 9.9.9.9), ensuring no bypass to public resolvers if SmartDNS becomes unreachable. |
DNSStubListener=yes |
Keeps the local stub active at 127.0.0.53, so applications and libraries continue to function normally. |
This configuration ensures all DNS queries are handled exclusively by SmartDNS, with no fallback to default or ISP resolvers, creating a fully leak-proof chain.
Apply:
1sudo systemctl restart systemd-resolved
2sudo resolvectl flush-cachesVerify:
1resolvectl statusExpected:
Current DNS Server: 127.0.0.1:65353
DNS Servers: 127.0.0.1:65353
3οΈβ£ Configure SmartDNS
Edit:
1sudo nano /etc/smartdns/smartdns.confMinimal configuration:
1bind 127.0.0.1:65353
2bind-tcp 127.0.0.1:65353
3
4server-tls 1.1.1.1:853 -bootstrap-dns -host-name cloudflare-dns.com
5server-tls 8.8.8.8:853 -bootstrap-dns -host-name dns.google
6
7server-h3 h3://dns.nextdns.io/<YOUR_NEXTDNS_ID> -host-name dns.nextdns.io -tls-host-verify dns.nextdns.io
8server-https https://dns.nextdns.io/<YOUR_NEXTDNS_ID> -host-name dns.nextdns.io -tls-host-verify dns.nextdns.io
9
10ca-file /etc/ssl/certs/ca-certificates.crt
11ca-path /etc/ssl/certsReplace <YOUR_NEXTDNS_ID> with your unique ID from
π https://my.nextdns.io/setup
Restart SmartDNS:
1sudo systemctl restart smartdnsπ§ͺ Verification
Check the resolver chain
1resolvectl statusβ DNS = 127.0.0.1:65353
Confirm NextDNS
1dig @127.0.0.1 -p 65353 whoami.nextdns.io TXT +shortExpected:
"Your NextDNS ID"
Verify no leaks
1sudo tcpdump -ni any port 53β No outbound DNS traffic to your router or ISP.
β Result
β SmartDNS listens only on 127.0.0.1:65353
β systemd-resolved forwards all DNS β SmartDNS
β NextDNS encrypts and filters DNS traffic
β No DHCP or ISP DNS overwrites
β Works flawlessly on Linux Mint 22.2 Cinnamon
π§Ύ Summary
| Component | Address | Role |
|---|---|---|
| systemd-resolved | 127.0.0.53 | Stub resolver |
| SmartDNS | 127.0.0.1:65353 | Local resolver |
| NextDNS | DoH3 / DoH2 | Encrypted upstream |
| NetworkManager | β | dns=none, rc-manager=unmanaged, systemd-resolved=false |
Enjoy your private, encrypted, and leak-free DNS setup on Linux Mint 22.2 Cinnamon.
#Linux Mint #SmartDNS #NextDNS #systemd-resolved #NetworkManager #Privacy #DNS