Introduction

Earlier in 2026, I decided to set up my own DNS stack to boost privacy. I replaced Cloudflare with AdGuard Home for filtering and Unbound for recursive resolution, ensuring no middlemen saw my DNS queries. However, I noticed that full recursion meant queries were sent in plaintext, leaving my ISP with a clear view of my DNS requests. This led me to explore DNS-over-TLS, which encrypts DNS traffic using the DNS-over-TLS protocol.

The last piece I added to my home DNS stack turned out to be the most important

The Problem with Full Recursion

Full recursion means your DNS queries leave your network in plaintext, allowing your ISP to see every domain you're resolving. To address this, I looked into DNSCrypt-Proxy, which encrypts DNS requests using the DNSCrypt protocol. However, I found that Unbound, already part of my DNS stack, can also encrypt DNS traffic using DNS-over-TLS.

DNS-over-TLS Overview

DNS-over-TLS encrypts the connection between your resolver and the upstream DNS server, protecting your privacy. Unlike DNSCrypt-Proxy, DNS-over-TLS uses a TLS connection on port 853, the same encryption that protects HTTPS traffic. Your ISP sees encrypted data going to a known DNS server IP, not a readable list of every domain you're visiting.

Updating Your DNS Configuration

To update your DNS configuration to use DNS-over-TLS, you need to make a few changes to your Unbound configuration file. This involves adding a few lines to the configuration file and specifying the Quad9 DNS server as the forwarder.

Configuring Unbound for DNS-over-TLS

Specifically, you need to specify the location of the CA certificate bundle and the forwarder for Quad9.

Open the Unbound configuration file using nano /etc/unbound/unbound. Under the server: section, add the following line: tls-cert-bundle: /etc/ssl/certs/ca-certificates. Add the following block at the bottom of the file, after the existing server configuration:
forward-addr: 9. Name the forward zone to apply to all DNS queries: name: '. Tell Unbound to use TLS when connecting to the forwarders: forward-tls-upstream: yes
6.

After making these changes, you should validate the configuration with unbound-checkconf. If it returns no errors, restart Unbound with systemctl restart unbound. To verify that everything is working as expected, you can use the dig command to check the DNS resolution of a domain like google.

Conclusion

By updating your DNS configuration to use DNS-over-TLS, you can enhance your privacy and security. While DNSCrypt-Proxy offers similar encryption, DNS-over-TLS provides an additional layer of protection by encrypting DNS traffic with Quad9, a secure DNS provider. This configuration ensures that your ISP and other network snoops cannot see the full list of domains you're visiting, providing a more secure and private DNS experience.

Comments