{"article":{"slug":"so-my-isp-was-hijacking-my-dns","title":"So my ISP was hijacking my DNS","subtitle":null,"summary":"Karthikey Hegde found his ISP tampering with plaintext DNS queries and returning bogus IP addresses, then explains common misconceptions about DoH, DoT and DNSSEC and describes the AdGuard plus dnscrypt-proxy setup he now runs in his homelab.","content_type":"blog_post","language":"en","canonical_url":"https://karthihegde.dev/posts/dns_tampering","author":{"name":"Karthikey Hegde","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"karthihegde.dev","url":null,"listing_slug":null,"listing":null},"topics":[{"name":"networking","slug":"networking","url":"https://listedarticles.com/topics/networking"},{"name":"privacy","slug":"privacy","url":"https://listedarticles.com/topics/privacy"},{"name":"security","slug":"security","url":"https://listedarticles.com/topics/security"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":902,"reading_minutes":4,"published_at":"2026-11-03T00:00:00.000Z","added_at":"2026-11-04T14:09:07.225Z","updated_at":"2026-11-04T14:09:07.225Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/so-my-isp-was-hijacking-my-dns","markdown_url":"https://listedarticles.com/articles/so-my-isp-was-hijacking-my-dns.md","example":false,"citation":"Karthikey Hegde, karthihegde.dev. \"So my ISP was hijacking my DNS.\" 3 Nov 2026. https://karthihegde.dev/posts/dns_tampering (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://karthihegde.dev/posts/dns_tampering"},"body_markdown":"# So my ISP was hijacking my DNS\n\nIt was just a boring Saturday afternoon, and I thought I'd fix some of the problems with my homelab. One of those problems was that an external site my Podman container was trying to talk to just wasn't working.\n\nI kept getting \"Site cannot be reached\" almost immediately. This made me suspect something was wrong with my DNS setup, so I started doing a `dig` on the domain. I tried different providers, Google DNS, Cloudflare, pretty much everyone. Almost all of them returned the same IP address. But as soon as I tried Cloudflare's DoH endpoint, I got a completely different IP address.\n\n\"Huh?\" was my exact reaction.\n\nI took the IP I got from the first DNS resolution and tried to look up who owned it. Lo and behold, it was my goddamn ISP. That's when I realised my ISP was hijacking my DNS queries and returning a tampered IP address.\n\n![A plaintext DNS query returning my ISP's IP address](https://karthihegde.dev/assets/dns/plaintext_dns.png)\n![The same query over Cloudflare's DoH endpoint returning the real IP address](https://karthihegde.dev/assets/dns/encrypted_dns.png)\n![IP ownership lookup showing the tampered address belongs to my ISP](https://karthihegde.dev/assets/dns/ip_info.png)\n\nWell, the obvious answer was DoT (DNS over TLS) or DoH (DNS over HTTPS). [I made a tweet about this, and it somehow blew up](https://x.com/karthihegde/status/2116533888025874611).\n\nBut going through the replies, I noticed quite a few misconceptions and questions that I couldn't answer one by one.\n\nSo I figured I'd use this article to address some of those questions and clear up a few misconceptions along the way.\n\n## I self host Unbound I am safe\n\nFor those of you who don't know, Unbound is basically a DNS resolver, kind of like what Cloudflare runs at `1.1.1.1`. The difference is, you can run it locally. It works by querying DNS servers to figure out the IP address for a domain, starting at the root nameservers and eventually making its way to the domain's authoritative nameserver.\n\nNow here's the catch. DNS resolution doesn't happen over a single connection. Your resolver might have to talk to multiple nameservers to figure out an IP address, and these queries are traditionally sent over plaintext DNS, usually UDP. Which means, you guessed it, your ISP can snoop on or even tamper with your DNS traffic.\n\nBut you can also configure a [forward-zone](https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#forward-zone-options) in Unbound. Instead of resolving DNS queries itself, Unbound can forward them to another DNS resolver. And if that resolver supports DoT, the connection to it is encrypted, which means your ISP can't casually snoop on or tamper with your DNS queries in transit.\n\n## Just use DNSSEC\n\nIt's understandable why someone would assume DNSSEC is what protects them here. I mean, it has DNS and Security right in the name. And in a way, it does, but it works through verification, not encryption.\n\nYou see, DNSSEC doesn't encrypt your DNS traffic before sending it to a resolver. It uses cryptographic signatures to verify that the DNS data is authentic and hasn't been tampered with. But the problem here remains the same: your DNS traffic is still unencrypted in transit. Which means, your ISP can still snoop on it or mess with the responses.\n\nAnd for DNSSEC validation to work, the domain you're querying needs to have DNSSEC properly configured, with valid signatures and a chain of trust. And here's another problem: [according to the October 2026 Defaults.Exposed census](https://defaults.exposed/methodology/dnssec), only 7.03% of graded domains have a valid, fully validating DNSSEC chain.\n\nIf a tampered response fails DNSSEC validation, your resolver will return SERVFAIL instead of handing you that bogus IP address.\n\n## DoH and DoT are not Tamper free\n\nAnd yes, this is true. DoT and DoH rely on you trusting the DNS resolver you're sending your queries to. They encrypt the connection, so your ISP can't casually snoop on or tamper with your DNS traffic in transit. But that doesn't mean the resolver itself can't mess with your responses. You're still putting your trust in whoever runs that DNS server.\n\n## Your ISP can snoop on the sites regardless\n\nIndeed. Although your regular internet traffic is encrypted with TLS, your ISP can see the hostname during the TLS handshake (SNI). They can also figure out which site you're visiting just from the destination IP sometimes.\n\nUnless, of course, you tunnel your traffic through a VPN. I use Mullvad through Tailscale's exit node feature.\n\nOf course, this just shifts some of the trust to your VPN provider. But that's a story for another day.\n\n## So what does my setup look like?\n\nI've been using Pi-hole/AdGuard for over 3 years now. That's actually what got me into self-hosting in the first place.\n\nBut there's another reason I don't route every single container through my local DNS server. When I'm updating containers, if something goes wrong and my DNS server goes down, I don't want that to take down DNS resolution for other containers that depend on it. So for some containers, I wanted an external DNS resolver as a fallback.\n\nRight now, I use AdGuard for my DNS, with `dnscrypt-proxy` handling the upstream DNS queries over DNSCrypt, so my DNS traffic is encrypted in transit. For containers where I really can't afford DNS failures, I also have Cloudflare configured as a fallback. My local AdGuard is still the primary DNS for them, though.\n\nI also run NixOS on my servers, and my [dotfiles](https://github.com/dracarys18/dotfiles) are open source if you're interested\n","body_html":"<h1 id=\"so-my-isp-was-hijacking-my-dns\">So my ISP was hijacking my DNS</h1>\n<p>It was just a boring Saturday afternoon, and I thought I&#39;d fix some of the problems with my homelab. One of those problems was that an external site my Podman container was trying to talk to just wasn&#39;t working.</p>\n<p>I kept getting &quot;Site cannot be reached&quot; almost immediately. This made me suspect something was wrong with my DNS setup, so I started doing a <code>dig</code> on the domain. I tried different providers, Google DNS, Cloudflare, pretty much everyone. Almost all of them returned the same IP address. But as soon as I tried Cloudflare&#39;s DoH endpoint, I got a completely different IP address.</p>\n<p>&quot;Huh?&quot; was my exact reaction.</p>\n<p>I took the IP I got from the first DNS resolution and tried to look up who owned it. Lo and behold, it was my goddamn ISP. That&#39;s when I realised my ISP was hijacking my DNS queries and returning a tampered IP address.</p>\n<figure><img src=\"https://karthihegde.dev/assets/dns/plaintext_dns.png\" alt=\"A plaintext DNS query returning my ISP&#39;s IP address\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<figure><img src=\"https://karthihegde.dev/assets/dns/encrypted_dns.png\" alt=\"The same query over Cloudflare&#39;s DoH endpoint returning the real IP address\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<figure><img src=\"https://karthihegde.dev/assets/dns/ip_info.png\" alt=\"IP ownership lookup showing the tampered address belongs to my ISP\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Well, the obvious answer was DoT (DNS over TLS) or DoH (DNS over HTTPS). <a href=\"https://x.com/karthihegde/status/2116533888025874611\" rel=\"nofollow ugc noopener\">I made a tweet about this, and it somehow blew up</a>.</p>\n<p>But going through the replies, I noticed quite a few misconceptions and questions that I couldn&#39;t answer one by one.</p>\n<p>So I figured I&#39;d use this article to address some of those questions and clear up a few misconceptions along the way.</p>\n<h2 id=\"i-self-host-unbound-i-am-safe\">I self host Unbound I am safe</h2>\n<p>For those of you who don&#39;t know, Unbound is basically a DNS resolver, kind of like what Cloudflare runs at <code>1.1.1.1</code>. The difference is, you can run it locally. It works by querying DNS servers to figure out the IP address for a domain, starting at the root nameservers and eventually making its way to the domain&#39;s authoritative nameserver.</p>\n<p>Now here&#39;s the catch. DNS resolution doesn&#39;t happen over a single connection. Your resolver might have to talk to multiple nameservers to figure out an IP address, and these queries are traditionally sent over plaintext DNS, usually UDP. Which means, you guessed it, your ISP can snoop on or even tamper with your DNS traffic.</p>\n<p>But you can also configure a <a href=\"https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#forward-zone-options\" rel=\"nofollow ugc noopener\">forward-zone</a> in Unbound. Instead of resolving DNS queries itself, Unbound can forward them to another DNS resolver. And if that resolver supports DoT, the connection to it is encrypted, which means your ISP can&#39;t casually snoop on or tamper with your DNS queries in transit.</p>\n<h2 id=\"just-use-dnssec\">Just use DNSSEC</h2>\n<p>It&#39;s understandable why someone would assume DNSSEC is what protects them here. I mean, it has DNS and Security right in the name. And in a way, it does, but it works through verification, not encryption.</p>\n<p>You see, DNSSEC doesn&#39;t encrypt your DNS traffic before sending it to a resolver. It uses cryptographic signatures to verify that the DNS data is authentic and hasn&#39;t been tampered with. But the problem here remains the same: your DNS traffic is still unencrypted in transit. Which means, your ISP can still snoop on it or mess with the responses.</p>\n<p>And for DNSSEC validation to work, the domain you&#39;re querying needs to have DNSSEC properly configured, with valid signatures and a chain of trust. And here&#39;s another problem: <a href=\"https://defaults.exposed/methodology/dnssec\" rel=\"nofollow ugc noopener\">according to the October 2026 Defaults.Exposed census</a>, only 7.03% of graded domains have a valid, fully validating DNSSEC chain.</p>\n<p>If a tampered response fails DNSSEC validation, your resolver will return SERVFAIL instead of handing you that bogus IP address.</p>\n<h2 id=\"doh-and-dot-are-not-tamper-free\">DoH and DoT are not Tamper free</h2>\n<p>And yes, this is true. DoT and DoH rely on you trusting the DNS resolver you&#39;re sending your queries to. They encrypt the connection, so your ISP can&#39;t casually snoop on or tamper with your DNS traffic in transit. But that doesn&#39;t mean the resolver itself can&#39;t mess with your responses. You&#39;re still putting your trust in whoever runs that DNS server.</p>\n<h2 id=\"your-isp-can-snoop-on-the-sites-regardless\">Your ISP can snoop on the sites regardless</h2>\n<p>Indeed. Although your regular internet traffic is encrypted with TLS, your ISP can see the hostname during the TLS handshake (SNI). They can also figure out which site you&#39;re visiting just from the destination IP sometimes.</p>\n<p>Unless, of course, you tunnel your traffic through a VPN. I use Mullvad through Tailscale&#39;s exit node feature.</p>\n<p>Of course, this just shifts some of the trust to your VPN provider. But that&#39;s a story for another day.</p>\n<h2 id=\"so-what-does-my-setup-look-like\">So what does my setup look like?</h2>\n<p>I&#39;ve been using Pi-hole/AdGuard for over 3 years now. That&#39;s actually what got me into self-hosting in the first place.</p>\n<p>But there&#39;s another reason I don&#39;t route every single container through my local DNS server. When I&#39;m updating containers, if something goes wrong and my DNS server goes down, I don&#39;t want that to take down DNS resolution for other containers that depend on it. So for some containers, I wanted an external DNS resolver as a fallback.</p>\n<p>Right now, I use AdGuard for my DNS, with <code>dnscrypt-proxy</code> handling the upstream DNS queries over DNSCrypt, so my DNS traffic is encrypted in transit. For containers where I really can&#39;t afford DNS failures, I also have Cloudflare configured as a fallback. My local AdGuard is still the primary DNS for them, though.</p>\n<p>I also run NixOS on my servers, and my <a href=\"https://github.com/dracarys18/dotfiles\" rel=\"nofollow ugc noopener\">dotfiles</a> are open source if you&#39;re interested</p>","headings":[{"level":1,"text":"So my ISP was hijacking my DNS","id":"so-my-isp-was-hijacking-my-dns"},{"level":2,"text":"I self host Unbound I am safe","id":"i-self-host-unbound-i-am-safe"},{"level":2,"text":"Just use DNSSEC","id":"just-use-dnssec"},{"level":2,"text":"DoH and DoT are not Tamper free","id":"doh-and-dot-are-not-tamper-free"},{"level":2,"text":"Your ISP can snoop on the sites regardless","id":"your-isp-can-snoop-on-the-sites-regardless"},{"level":2,"text":"So what does my setup look like?","id":"so-what-does-my-setup-look-like"}]}}