<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: NXVL</title>
    <description>The latest articles on DEV Community by NXVL (@manpage).</description>
    <link>https://dev.to/manpage</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4198975%2F65dc52c8-8434-4743-b6dc-f065431dd023.png</url>
      <title>DEV Community: NXVL</title>
      <link>https://dev.to/manpage</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manpage"/>
    <language>en</language>
    <item>
      <title>I`m sorry but your device is acting kinda..wired..</title>
      <dc:creator>NXVL</dc:creator>
      <pubDate>Sat, 24 Oct 2026 14:30:33 +0000</pubDate>
      <link>https://dev.to/manpage/im-sorry-but-your-device-is-acting-kindawired-5172</link>
      <guid>https://dev.to/manpage/im-sorry-but-your-device-is-acting-kindawired-5172</guid>
      <description>&lt;p&gt;H..Have you ever thought who your device chats with behind your back?&lt;/p&gt;

&lt;p&gt;Right now your phone is face-down on the table, looking innocent, while it makes small talk with servers you have never met. Your TV is doing the same. So is the smart plug you bought in a moment of optimism and forgot about.&lt;/p&gt;

&lt;p&gt;Nobody invited them to the group chat. They started it themselves.&lt;/p&gt;

&lt;p&gt;The good news: you can read the minutes of the meeting, no hoodie required. Every one of those chats starts with a DNS lookup, and a resolver can write each one down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Hire a resolver that takes notes
&lt;/h2&gt;

&lt;p&gt;You need a resolver with a query log that records the &lt;strong&gt;client&lt;/strong&gt;, the &lt;strong&gt;name&lt;/strong&gt;, the &lt;strong&gt;record type&lt;/strong&gt; and the &lt;strong&gt;result&lt;/strong&gt;. Pi-hole and AdGuard Home both do. Hosted filters like NextDNS and Control D do too, and you can also run your own private node, which is what I do with &lt;a href="https://nxvalue.com/" rel="noopener noreferrer"&gt;NxValue Stack&lt;/a&gt; (yes, that one is ours, so weigh my opinion accordingly).&lt;/p&gt;

&lt;p&gt;The catch is NAT. If every query reaches the resolver &lt;em&gt;through your router&lt;/em&gt;, the log shows the whole house as one very busy client. To get a per-device view, either let the resolver hand out DHCP leases so it knows each device by name, point each device at it directly, or use an engine that supports per-client identifiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Leave it alone and make tea
&lt;/h2&gt;

&lt;p&gt;Use your devices normally, then stop touching them. Idle traffic is the interesting part. A day shows the pattern, and a week catches the weekly habits, like the TV that checks in when it thinks you are asleep.&lt;/p&gt;

&lt;p&gt;To watch it live on a machine you control, &lt;code&gt;sudo tcpdump -n -i any port 53&lt;/code&gt; prints every plain DNS query leaving that host, which is a fun way to see how chatty one laptop is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Read the log like a detective
&lt;/h2&gt;

&lt;p&gt;A typical entry looks like this (illustrative, with made-up names):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10:02:11  tv-livingroom   A      metrics.example-vendor.net   blocked
10:02:11  tv-livingroom   AAAA   metrics.example-vendor.net   blocked
10:02:14  tv-livingroom   A      updates.example-vendor.net   allowed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Things worth noticing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fixed intervals.&lt;/strong&gt; A query every 60 seconds on the dot is a heartbeat or status check. Normal, but it tells you how the device behaves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A burst of different names.&lt;/strong&gt; Often an app or device starting up. A sustained flood is worth a look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Repeated failures.&lt;/strong&gt; Lots of &lt;code&gt;NXDOMAIN&lt;/code&gt; for random-looking names can mean a broken config, or a device retrying something that is blocked or gone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paired &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;AAAA&lt;/code&gt; queries.&lt;/strong&gt; Normal: one asks for IPv4, the other for IPv6.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most names fall into five characters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Plumbers.&lt;/strong&gt; Connectivity checks and time sync, like &lt;code&gt;connectivitycheck.gstatic.com&lt;/code&gt; (Android), &lt;code&gt;captive.apple.com&lt;/code&gt; (Apple) and &lt;code&gt;pool.ntp.org&lt;/code&gt;. Boring and necessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Vendor's Staff.&lt;/strong&gt; Updates and cloud features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Delivery Crew.&lt;/strong&gt; Long names from CDNs and cloud hosts. Usually fine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Gossips.&lt;/strong&gt; Advertising, analytics and telemetry.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Mystery Guests.&lt;/strong&gt; Names you do not recognise. Search before you judge.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ask of each device: &lt;em&gt;does this make sense for what it does?&lt;/em&gt; A lightbulb chatting with an advertising network deserves a raised eyebrow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Show the Gossips the door (carefully)
&lt;/h2&gt;

&lt;p&gt;Blocking is easy. Not breaking your TV afterwards is the real skill.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Block a few names at a time, not the whole internet.&lt;/li&gt;
&lt;li&gt;Know what a blocked answer looks like. Filters usually reply with &lt;code&gt;0.0.0.0&lt;/code&gt; or &lt;code&gt;NXDOMAIN&lt;/code&gt;. Some devices retry hard after a failure, which shows up as a spike for that domain.&lt;/li&gt;
&lt;li&gt;Use the device afterwards. If something breaks, find the blocked name in the log and allow it again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Some limits to know about
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Names, not content.&lt;/strong&gt; You can see who the TV called, not what it said.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A weird domain is a clue, not a verdict.&lt;/strong&gt; Plenty of odd names belong to boring cloud providers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Some devices skip your DNS&lt;/strong&gt; with a hardcoded resolver or built-in DoH. A suspiciously quiet device may be talking elsewhere. Routers can redirect or block outbound port 53 to catch the hardcoded ones, but DoH on port 443 is much harder to spot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CNAME cloaking.&lt;/strong&gt; A tracker can hide behind a name on the site's own domain, using a &lt;code&gt;CNAME&lt;/code&gt; that points to the tracker. Some filters can inspect the chain and block it, but not all do.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not a full ad blocker.&lt;/strong&gt; Ads served from the same domain as the content, like YouTube or Twitch video ads, cannot be separated at DNS level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Home only sees home.&lt;/strong&gt; To keep filtering on mobile data, the resolver needs encrypted endpoints (DoT or DoH) your phone can reach anywhere.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Your devices talk constantly, and DNS is the easiest place to listen in.&lt;/li&gt;
&lt;li&gt;A resolver with a per-device log shows who asked for what, as long as NAT does not hide the client.&lt;/li&gt;
&lt;li&gt;Read for patterns: intervals, bursts, failures, and names that do not fit the device.&lt;/li&gt;
&lt;li&gt;Block gradually, test each change, and remember the limits: hardcoded DNS, DoH and CNAME cloaking can all slip past.&lt;/li&gt;
&lt;li&gt;The first look at your log is usually hilarious and slightly unsettling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Pi-hole is a registered trademark of Pi-hole LLC. AdGuard Home is a trademark of AdGuard Software Limited. NextDNS and Control D are trademarks of their respective owners. NxValue Stack is an independent service provider and is not affiliated with or sponsored by any of these projects or companies.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>discuss</category>
    </item>
    <item>
      <title>What Happens in the 50 ms Before Every Request: A Walkthrough of DNS Resolution</title>
      <dc:creator>NXVL</dc:creator>
      <pubDate>Sat, 24 Oct 2026 08:20:34 +0000</pubDate>
      <link>https://dev.to/manpage/what-happens-in-50ms-before-every-request-37pb</link>
      <guid>https://dev.to/manpage/what-happens-in-50ms-before-every-request-37pb</guid>
      <description>&lt;p&gt;You type &lt;code&gt;example.com&lt;/code&gt; and press Enter. Before your browser sends a single byte of HTTP, before TLS starts, before any page content exists, something else has to happen first: your device has to work out &lt;em&gt;where&lt;/em&gt; &lt;code&gt;example.com&lt;/code&gt; actually is.&lt;/p&gt;

&lt;p&gt;That job is DNS, and on an uncached lookup it often takes somewhere in the region of 20 to 150 milliseconds, depending on where you are and who you ask. The "50 ms" in the title is a rough middle, not a promise. It is also a delay that stacks up: a modern web page can touch dozens of domains, and every new one starts with the same question.&lt;/p&gt;

&lt;p&gt;This guide follows one lookup from start to finish, so you know what is happening, where the time goes, and what you can measure and control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Your device checks its own memory first
&lt;/h2&gt;

&lt;p&gt;The fastest DNS lookup is the one that never leaves your machine. Several layers get a chance to answer before anything touches the network:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The browser's own cache.&lt;/strong&gt; Browsers keep a short-lived list of recent lookups.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The operating system's stub resolver.&lt;/strong&gt; &lt;code&gt;systemd-resolved&lt;/code&gt; on many Linux systems, &lt;code&gt;mDNSResponder&lt;/code&gt; on macOS and iOS, the DNS Client service on Windows. It keeps its own cache and decides which server to ask.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The hosts file.&lt;/strong&gt; A manual override that wins over everything else.
If any of these has a fresh answer, the cost is effectively zero. If not, the stub resolver sends the question out.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is called a &lt;em&gt;stub&lt;/em&gt; because it is deliberately simple: it does not do any real resolving. It just forwards the question to a &lt;strong&gt;recursive resolver&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: The question goes to a recursive resolver
&lt;/h2&gt;

&lt;p&gt;Which server gets the question depends on your settings. Usually it came from DHCP, so it is your router, which forwards to your ISP's resolver. Some people point their device at a big public resolver instead. Others point it at a resolver they run themselves.&lt;/p&gt;

&lt;p&gt;Two things matter at this hop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Distance.&lt;/strong&gt; A resolver on your local network answers in a couple of milliseconds. One across the country does not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Transport.&lt;/strong&gt; Classic DNS is plain text over UDP port 53, so anyone on the path can read it. DNS-over-TLS (port 853) and DNS-over-HTTPS (port 443) wrap the same question in encryption. The lookup itself is unchanged; only the envelope is.
The recursive resolver is the part that does the real work, and it has a cache of its own.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 3: The resolver's cache usually saves the day
&lt;/h2&gt;

&lt;p&gt;When the question arrives, the resolver looks in its cache. If another user asked for the same name recently and the record has not expired, you get the answer straight away, usually in under a millisecond of processing.&lt;/p&gt;

&lt;p&gt;Expiry is controlled by the &lt;strong&gt;TTL&lt;/strong&gt; (time to live) on each record. A site that sets a TTL of 300 is telling every resolver: you may reuse this answer for five minutes. Low TTLs let site owners move traffic quickly. High TTLs mean fewer lookups and faster responses.&lt;/p&gt;

&lt;p&gt;Caches also remember &lt;strong&gt;negative answers&lt;/strong&gt;. If you look up a name that does not exist, that "no such domain" result is cached too, for a period set by the zone's SOA record, so a typo does not trigger a full search every time.&lt;/p&gt;

&lt;p&gt;Most of the time, this is where the story ends. The harder case is a cache miss.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: The walk, from the root down
&lt;/h2&gt;

&lt;p&gt;On a miss, a recursive resolver starts at the top and works down, one referral at a time. For &lt;code&gt;www.example.com&lt;/code&gt; it goes roughly like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ask a root server:&lt;/strong&gt; "Where is &lt;code&gt;www.example.com&lt;/code&gt;?" The root does not know, but it knows who runs &lt;code&gt;.com&lt;/code&gt; and points you to those servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask a &lt;code&gt;.com&lt;/code&gt; server.&lt;/strong&gt; It does not know either, but it knows which name servers are responsible for &lt;code&gt;example.com&lt;/code&gt;, and returns them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask the authoritative server for &lt;code&gt;example.com&lt;/code&gt;.&lt;/strong&gt; This one holds the real record and returns the address.
You can watch this happen with &lt;code&gt;dig +trace&lt;/code&gt;. This is trimmed and the address is a documentation placeholder, but the shape is real:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dig +trace www.example.com

.                518400  IN  NS   a.root-servers.net.
...
com.             172800  IN  NS   a.gtld-servers.net.
...
example.com.     172800  IN  NS   a.iana-servers.net.
...
www.example.com. 300     IN  A    203.0.113.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the TTLs. Root and TLD referrals are cached for a long time (days), so in practice a busy resolver &lt;strong&gt;almost never contacts the root servers at all&lt;/strong&gt;. It already knows who runs &lt;code&gt;.com&lt;/code&gt;. A "cold" lookup for a domain nobody has asked about in a while usually costs just one or two network round trips, not three or four. That is why recursive resolving is faster in real life than it looks on paper.&lt;/p&gt;

&lt;p&gt;Two refinements are worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;QNAME minimisation.&lt;/strong&gt; A careful resolver does not send the full name to every server. The root only needs to know you are asking about &lt;code&gt;.com&lt;/code&gt;, not that you want &lt;code&gt;www.example.com&lt;/code&gt;. Recent versions of Unbound do this by default, which limits how much each server on the path learns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glue records.&lt;/strong&gt; If the name servers for a domain live inside that same domain, the parent zone supplies their addresses alongside the referral, avoiding a chicken-and-egg problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 5: DNSSEC adds a verification step
&lt;/h2&gt;

&lt;p&gt;Plain DNS has no built-in way to prove an answer is genuine. DNSSEC fixes that with a chain of signatures: each zone signs its records, and the parent zone vouches for the child's signing key, all the way up to the root.&lt;/p&gt;

&lt;p&gt;A validating resolver checks that chain. If a signature is wrong or missing where one is required, it returns an error instead of a forged answer. When validation succeeds, the response carries the &lt;strong&gt;AD (authenticated data)&lt;/strong&gt; flag.&lt;/p&gt;

&lt;p&gt;The cost is a few extra lookups for keys and signatures (&lt;code&gt;DNSKEY&lt;/code&gt;, &lt;code&gt;DS&lt;/code&gt;, &lt;code&gt;RRSIG&lt;/code&gt; records), but those are cached too, so the overhead is small after the first few queries. One honest limit: DNSSEC proves an answer is &lt;em&gt;authentic&lt;/em&gt;. It does not make it &lt;em&gt;private&lt;/em&gt;. That is a separate job, handled by encrypted transport.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where filtering fits in
&lt;/h2&gt;

&lt;p&gt;Everything above describes a plain resolver. A DNS filter such as Pi-hole or AdGuard Home sits in front of the resolving step, between your device and the walk.&lt;/p&gt;

&lt;p&gt;The filter checks the requested name against your blocklists. If it matches an ad network, a tracker, or a telemetry domain, the filter answers immediately with a "nowhere" response (typically &lt;code&gt;0.0.0.0&lt;/code&gt; or &lt;code&gt;NXDOMAIN&lt;/code&gt;), and no recursive walk ever happens.&lt;/p&gt;

&lt;p&gt;That has a side effect that surprises people: &lt;strong&gt;a blocked lookup is usually faster than an allowed one&lt;/strong&gt;, because it is answered locally with no network hop at all. On a page loaded with third-party trackers, that adds up, along with the bandwidth you no longer spend downloading them.&lt;/p&gt;

&lt;p&gt;Only the allowed names continue down to the recursive resolver.&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting numbers on it
&lt;/h2&gt;

&lt;p&gt;Here is a rough picture of where time goes. These are typical ranges, not benchmarks, and your results will differ:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Browser or OS cache hit:&lt;/strong&gt; ~0 ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your device to a local resolver:&lt;/strong&gt; 1–10 ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resolver cache hit:&lt;/strong&gt; under 1 ms of processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blocked by a filter:&lt;/strong&gt; under 1 ms of processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache miss, one or two hops to authoritative servers:&lt;/strong&gt; 20–150 ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First lookup after a record expires:&lt;/strong&gt; same as a miss
The slow case is rare but memorable. Unbound has settings that smooth it out: &lt;strong&gt;prefetch&lt;/strong&gt; refreshes popular records shortly before they expire, so the next request still finds a warm cache, and &lt;strong&gt;serve-expired&lt;/strong&gt; can briefly answer from an expired entry while it updates in the background.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Measure it yourself
&lt;/h2&gt;

&lt;p&gt;You do not have to take any of this on trust. &lt;code&gt;dig&lt;/code&gt; shows the time for each query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig example.com | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s2"&gt;"Query time"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it twice. The first run may be a cache miss, and the second should be close to instant. To test a specific resolver, name it directly. For example, a local Unbound listening on port 5335:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig @127.0.0.1 &lt;span class="nt"&gt;-p&lt;/span&gt; 5335 example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see the validation result, add &lt;code&gt;+dnssec&lt;/code&gt; and look for &lt;code&gt;ad&lt;/code&gt; in the flags line of a signed domain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who sees what along the way
&lt;/h2&gt;

&lt;p&gt;Each hop learns something, and the picture changes depending on who you ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your ISP&lt;/strong&gt; can read plain DNS on the wire, and often runs the default resolver.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A large public resolver&lt;/strong&gt; sees every name you look up, tied to your connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authoritative servers&lt;/strong&gt; see only the resolver's address, not yours, plus whatever part of the name the resolver chose to send.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A resolver you control&lt;/strong&gt; that starts from the root means no single outside party sees your whole lookup history.
Encrypting DNS hides your questions from the network between you and the resolver. It does not hide the &lt;em&gt;IP address&lt;/em&gt; you then connect to, and in many cases the site name still appears in the TLS handshake. DNS privacy is one layer, not a cloak.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Running the whole chain yourself
&lt;/h2&gt;

&lt;p&gt;Everything above can be assembled on a small server. A filter handles blocking, Unbound handles recursion and DNSSEC validation, and an encrypted endpoint carries the queries from your devices. We walk through the self-built version in &lt;a href="https://nxvalue.com/guides/pihole-unbound-recursive-dns" rel="noopener noreferrer"&gt;Pi-hole with Unbound&lt;/a&gt;, and in &lt;a href="https://nxvalue.com/guides/encrypted-dns-doh-dot-every-device" rel="noopener noreferrer"&gt;Encrypted DNS Explained&lt;/a&gt; for the DoH and DoT side.&lt;/p&gt;

&lt;p&gt;It is a good weekend project, and it is also a lot of small pieces to keep patched and certified. If you would rather skip that part, &lt;a href="https://nxvalue.com/" rel="noopener noreferrer"&gt;NxValue Stack&lt;/a&gt; runs this exact chain for you: your own isolated node with Pi-hole or AdGuard Home in front of Unbound, plus DoH and DoT endpoints already set up. It is billed hourly (the BASE-N plan is $4/month) and you can delete it at any time. You can look at a live dashboard in the &lt;a href="https://nxvalue.com/test/v1/" rel="noopener noreferrer"&gt;demo node&lt;/a&gt;. It is shared publicly and meant for testing only, not personal use.&lt;/p&gt;

&lt;p&gt;Either route gives you the same architecture. The difference is who does the maintenance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some limits to know about
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Your first visit to a rarely used domain can still be slow.&lt;/strong&gt; A recursive resolver has to do the walk once. After that the cache takes over.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS speed is not page speed.&lt;/strong&gt; A faster lookup trims the start of a request, but it cannot fix a slow server or a heavy page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filtering is not a full ad blocker.&lt;/strong&gt; DNS cannot separate ads served from the same domain as the content, such as YouTube or Twitch video ads. A browser content blocker covers that gap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aggressive blocklists can break things.&lt;/strong&gt; A login page or a streaming app may stop working until you allow the domain. The query log shows you which name to look for.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;A resolver you run is a point of failure.&lt;/strong&gt; Always have a sensible fallback so the internet keeps working if it goes down.&lt;/p&gt;
&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Every request starts with a DNS lookup, and a cache hit makes it nearly free.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On a miss, a recursive resolver follows referrals from root to TLD to the authoritative server, though root and TLD answers are usually cached, so the real cost is often just one or two round trips.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNSSEC proves answers are genuine; encrypted transport (DoT or DoH) keeps the question private on the way to the resolver.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A DNS filter answers blocked names immediately, which makes them faster than allowed ones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can measure all of it with &lt;code&gt;dig&lt;/code&gt;, and you can run the whole chain yourself, on your own hardware or on a managed node.&lt;br&gt;
&lt;em&gt;Pi-hole is a registered trademark of Pi-hole LLC. AdGuard Home is a trademark of AdGuard Software Limited. NxValue Stack is an independent service provider and is not affiliated with or sponsored by either project.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>dns</category>
      <category>networking</category>
      <category>devops</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>Pi-hole with Unbound: Private Recursive DNS Explained</title>
      <dc:creator>NXVL</dc:creator>
      <pubDate>Wed, 21 Oct 2026 19:15:00 +0000</pubDate>
      <link>https://dev.to/manpage/pi-hole-with-unbound-private-recursive-dns-explained-46m5</link>
      <guid>https://dev.to/manpage/pi-hole-with-unbound-private-recursive-dns-explained-46m5</guid>
      <description>&lt;p&gt;Most "private DNS" setups only move your trust around. You stop asking your ISP and start asking Google, Cloudflare, or Quad9 instead. Pi-hole with Unbound goes a step further: &lt;strong&gt;block unwanted domains first, then resolve everything else yourself&lt;/strong&gt;, with no public resolver in the middle.&lt;/p&gt;

&lt;p&gt;This guide explains how the two pieces fit together, how to build the setup on your own server, and what it does and does not protect.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two pieces
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pi-hole&lt;/strong&gt; is a DNS filter. Your devices ask it for a domain name, and it checks the request against your blocklists. If the domain is an ad network, tracker, or telemetry endpoint, Pi-hole answers with "nothing here" and the connection never starts. It also keeps a query log, so you can see which device asked for what.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unbound&lt;/strong&gt; is a &lt;em&gt;recursive&lt;/em&gt; DNS resolver. A normal setup forwards your questions to a big public resolver that does the work for you. Unbound does the work itself: it starts at the DNS root servers, follows the chain to the &lt;code&gt;.com&lt;/code&gt; servers, then to the domain's own authoritative servers, and caches the answer. It also validates &lt;strong&gt;DNSSEC&lt;/strong&gt; signatures, so forged answers are rejected.&lt;/p&gt;

&lt;p&gt;Put together, the flow looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your device
   │  (DoT / DoH, encrypted)
   ▼
Pi-hole        → blocked? answer immediately, nothing leaves the server
   │  (allowed)
   ▼
Unbound        → recursive lookup + DNSSEC validation + cache
   │
   ▼
Root → TLD → authoritative servers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why not just forward to Cloudflare or Quad9?
&lt;/h2&gt;

&lt;p&gt;Forwarding is fast and simple, and for many people it is a fine choice. The trade-off is that one company sees the full list of domains you look up, from every device, tied to your IP address.&lt;/p&gt;

&lt;p&gt;With Unbound as the upstream:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No single resolver sees your whole history.&lt;/strong&gt; Each authoritative server only sees the question it is responsible for, such as "what is the address of &lt;code&gt;example.com&lt;/code&gt;?".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You do not depend on a third party's uptime or policy.&lt;/strong&gt; Nobody can change filtering or logging rules underneath you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNSSEC is checked on your own server&lt;/strong&gt;, not trusted from someone else's answer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Option A: Build it yourself
&lt;/h2&gt;

&lt;p&gt;These steps assume a small Debian or Ubuntu server with Pi-hole already installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install Unbound
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unbound
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Configure it to listen only on localhost
&lt;/h3&gt;

&lt;p&gt;Create &lt;code&gt;/etc/unbound/unbound.conf.d/pi-hole.conf&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;verbosity&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;

    &lt;span class="na"&gt;interface&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;127.0.0.1&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5335&lt;/span&gt;
    &lt;span class="na"&gt;do-ip4&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yes&lt;/span&gt;
    &lt;span class="na"&gt;do-udp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yes&lt;/span&gt;
    &lt;span class="na"&gt;do-tcp&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yes&lt;/span&gt;
    &lt;span class="na"&gt;do-ip6&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;no&lt;/span&gt;

    &lt;span class="na"&gt;harden-glue&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yes&lt;/span&gt;
    &lt;span class="na"&gt;harden-dnssec-stripped&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yes&lt;/span&gt;
    &lt;span class="na"&gt;use-caps-for-id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;no&lt;/span&gt;
    &lt;span class="na"&gt;edns-buffer-size&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1232&lt;/span&gt;

    &lt;span class="na"&gt;prefetch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yes&lt;/span&gt;
    &lt;span class="na"&gt;num-threads&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;

    &lt;span class="na"&gt;private-address&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;192.168.0.0/16&lt;/span&gt;
    &lt;span class="na"&gt;private-address&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;172.16.0.0/12&lt;/span&gt;
    &lt;span class="na"&gt;private-address&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;10.0.0.0/8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Port &lt;code&gt;5335&lt;/code&gt; keeps Unbound out of Pi-hole's way on port 53. Binding to &lt;code&gt;127.0.0.1&lt;/code&gt; means nothing outside the server can talk to it directly. The &lt;code&gt;private-address&lt;/code&gt; lines stop Unbound from returning answers that point into your private network, which helps against DNS rebinding.&lt;/p&gt;

&lt;p&gt;Restart it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart unbound
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Test Unbound on its own
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig example.com @127.0.0.1 &lt;span class="nt"&gt;-p&lt;/span&gt; 5335
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should get an answer with &lt;code&gt;status: NOERROR&lt;/code&gt;. Now check that DNSSEC validation works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig sigfail.verteiltesysteme.net @127.0.0.1 &lt;span class="nt"&gt;-p&lt;/span&gt; 5335
dig sigok.verteiltesysteme.net @127.0.0.1 &lt;span class="nt"&gt;-p&lt;/span&gt; 5335
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first must return &lt;code&gt;SERVFAIL&lt;/code&gt; (a deliberately broken signature, correctly rejected). The second must return &lt;code&gt;NOERROR&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Point Pi-hole at Unbound
&lt;/h3&gt;

&lt;p&gt;In the Pi-hole web interface:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings → DNS&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Untick every public upstream (Google, Cloudflare, and so on).&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Custom DNS servers&lt;/strong&gt;, add &lt;code&gt;127.0.0.1#5335&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Save.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From now on, anything Pi-hole allows is resolved by Unbound.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Encrypt the path from your devices
&lt;/h3&gt;

&lt;p&gt;Plain DNS between your phone and your server is readable by anyone on the network path. To fix that, expose your Pi-hole over &lt;strong&gt;DoT&lt;/strong&gt; (port 853) or &lt;strong&gt;DoH&lt;/strong&gt; (port 443) using a TLS-terminating proxy in front of it, such as stunnel, nginx, or dnsdist, with a valid certificate for a hostname you own. Then use that hostname in Android's &lt;strong&gt;Private DNS&lt;/strong&gt; setting or the equivalent on iOS and macOS.&lt;/p&gt;

&lt;p&gt;Expect to spend most of your time on this step: certificates, renewals, firewall rules, and keeping the proxy updated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Option B: Let a managed node do it
&lt;/h2&gt;

&lt;p&gt;If you want the same architecture without the maintenance, NxValue Stack provisions a &lt;strong&gt;private Pi-hole + Unbound node&lt;/strong&gt; for you. It is not a shared public resolver: it is your own isolated server running open-source Pi-hole and Unbound, configured for you alone.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unbound runs as a DNSSEC-validating recursive resolver on your node.&lt;/li&gt;
&lt;li&gt;DoH and DoT endpoints are generated for you, so you paste one hostname into Private DNS and you are done.&lt;/li&gt;
&lt;li&gt;The dashboard shows live queries and blocked domains per device, and you can export or delete your data at any time.&lt;/li&gt;
&lt;li&gt;Billing is hourly and you can cancel anytime. The BASE-N plan is &lt;strong&gt;$4/month&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can try the &lt;a href="//nxvalue.com/test/v1/"&gt;demo node here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Some limits to this setup
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Encrypted DNS stops your ISP and local network from reading your DNS lookups, but they can still see the IP addresses you connect to&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The first lookup of a domain can be slower.Recursion has to walk the chain of servers. Caching and &lt;code&gt;prefetch&lt;/code&gt; hide most of this after a short warm-up.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authoritative servers still see your server's IP. They just cannot see a complete profile of you the way a single big well-known forwarder like Google/CF would.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DNS blocking is not a full ad blocker.&lt;/strong&gt; First-party ads, such as video ads on YouTube or Twitch, come from the same domains as the content and cannot be separated at the DNS level. Pair Pi-hole with a browser content blocker for full coverage.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pi-hole&lt;/strong&gt; decides &lt;em&gt;what&lt;/em&gt; gets resolved. &lt;strong&gt;Unbound&lt;/strong&gt; decides &lt;em&gt;how&lt;/em&gt;, without a public resolver.&lt;/li&gt;
&lt;li&gt;Self-hosting gives you full control, at the cost of setting up TLS, certificates, and maintenance.&lt;/li&gt;
&lt;li&gt;A managed private node gives you the same stack with encrypted endpoints ready in about a minute.&lt;/li&gt;
&lt;li&gt;Either way, the result is DNS that blocks trackers, validates DNSSEC, and does not funnel your history into one large resolver.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Pi-hole is a registered trademark of Pi-hole LLC. NxValue Stack is an independent service provider and is not affiliated with Pi-hole LLC.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
