DNS-over-TLS in Ubuntu 18.04 .... 20.04
Based on my experience, it will not work the way mentioned above on Ubuntu 18.04+ (i.e. U19, U20).
Since Ubuntu 18+ uses Netplan in parallel with NetworkManager things have changed drastically:
No more manual config in the traditional ways ;-(
Documentation is .... sparse.
snap may bring further changes. It establishes additional resolved.conf files. However, the following actually worked (/w good performance).
For Info about Netplan look here.
What DNS-over-TLS was working successful (works4me):
ONLY change the DNSOverTLS setting to
There is NO other option (see explanation here: DNS over TLS
- Use a capable DNS Server.
I prefer Digitalcourage servers
220.127.116.11 resp. 2a02:2970:1002::18
- This should be done in Network-Manager via GUI!
Enter the DNS server address in the GUI field for your connection under
IPv4 Settings / DNS Servers
and v6 respectively.
The entries will NOT show up in
/etc/resolv.conf !! Which is correct. Instead, you will see nameserver 127.0.0.53
This is new Ubuntu .... no longer suitable for hobby-admins.
- Not recommended but possible alternative
Setting appropriate DNS Servers can be done directly in
/etc/resolv.conf in the usual format, remove the 127.0.0.53 or something else.
Problem: Gets overwritten by Network-Manager in Ubuntu!
Remedy: As true root (!) chattr the file /etc/resolv.conf
chattr +i /etc/resolv.conf
This is brute force and may disable automatic DNS caching via resolved.
Credit to the Arch documentation
However, works fine ;-) but needs manual maintenance as true root!
You are well advised to make
resolv.conf a link. This is required by resolved to work properly. As sudo-root move away the old file then
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
I do not like this way but is inherently working proper.
Then reboot. Or restart network.
How to check
- Some basic checks:
Check the DNS actually used by systemd-resolved:
Check if DNS resolves with resolvectl:
resolvectl query archlinux.org
(Try some examples)
Check what DNS is actually used, check for leaks in VPN:
Start Wireshark and filter for "port 53" and make web traffic.
This should not show connects on port 53 any longer.
Then filter for port 853. Here should a lot go on.
Important: If all traffic uses port 853 and no traffic uses 53 you did it successfully!
Wireshark examples here.
I tried stubby. stubby does not integrate well in Ubuntu but you can get it working even with NetworkManager.
There is one manual to do it successfully:
How to use DNS-over-TLS on Ubuntu Linux
Problem: performance was a bit of a pain. Something is weird and I did not find out the cause.
Enabling DNSSEC=yes in /etc/systemd/resolved.conf should be possible now.
This solution improves privacy a lot.
BUT is NOT sufficient if your personal integrity depends on data privacy and security!! See caveats in resolvd description. It is NOT sufficient to have opportunistic mode. Then better watch out for Tails Linux.
A sad greeting to all political prisoners around the world.