brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: dig can speak DoH and DoT itself

Dig
~/tips/tip-dns-dig-doh-dot

dig +tls @dns.quad9.net example.com

Tests whether a DNS server answers over encrypted DoT or DoH.

You can set up encrypted DNS in a browser or a router and still not be sure it works. The simplest test is to talk to the server the same way yourself.

Recent versions of dig have +tls for DNS over TLS (port 853) and +https for DNS over HTTPS (port 443).

dig +tls @dns.quad9.net example.com
dig +https @dns.google example.com

If the answer comes back, the server accepts encrypted queries and its certificate checks out. If it fails, you know the problem is the server, a firewall or a captive network, not your browser settings. It is the quickest way I know to check a DoT or DoH upstream before pasting it into AdGuard Home or a router.

The caveat is the dig build. Both options only exist in dig builds with support for them, so an old distro package may not have them. Check what you have with dig -v and update the tools if the option is missing. Also note that this tests the path to one server, not what your devices do by default.

Before you point the whole house at an encrypted upstream, check whether it answers at all. Run it from the same network the traffic will leave from.

Further reading: dig manual (BIND 9), On this site: dig +ttlunits makes TTLs readable, On this site: run dig twice and watch the TTL count down

Going deeper: Guide: dig for beginners, look up DNS records and read the answer

More Dig tips dig +noall +answer DS example.com dig nope.iana.org @9.9.9.9 | grep -E 'status|SOA' dig +search nas dig @8.8.8.8 www.google.com +subnet=203.0.113.0/24 dig +yaml example.com A All Dig tips (36) All topics

Link