Network security

How to Configure a Homelab DNS Server: Pi-hole, AdGuard and Unbound

A homelab DNS server gives you local names, network-wide ad blocking and faster lookups. Here is how to choose, install and configure it safely.

Cysoro Security TeamPublished · 7 min read
nas.home192.168.1.53DNS : 53NETWORK SECURITYHomelab DNSserverLocal names. Network-wide blocking.
Quick answer

To configure a homelab DNS server, give an always-on machine a fixed IP, install Pi-hole or AdGuard Home, choose an upstream resolver such as Quad9 or Cloudflare, add local records for your services, point your router's DHCP DNS setting at the server, and test with dig or nslookup. Optionally add Unbound as a local recursive resolver on port 5335 for DNSSEC validation and less reliance on a public resolver.

Key takeaways

  • Pi-hole or AdGuard Home is the simplest homelab DNS server for most people.
  • Point your router's DHCP DNS at the server's fixed LAN IP — that is how clients find it.
  • Add Unbound only if you want local recursion and DNSSEC; keep a fallback DNS plan.

Your router's default DNS works, but it tells you nothing, blocks nothing and gives your devices no local names. A homelab DNS server fixes all three: it resolves your own services, blocks ads and trackers network-wide, and shows you what every device is asking for.

What is a homelab DNS server?

A homelab DNS server is a DNS resolver you run on your own home network, usually on a Raspberry Pi, mini-PC, NAS or virtual machine. It answers name lookups for your devices instead of sending every query straight to your ISP or a public resolver.

DNS is the phone book of the internet: it turns names such as example.com into IP addresses. A homelab server sits between your devices and the wider internet, so it can cache answers, filter bad domains and answer local names itself.

Most setups use one of two free tools: Pi-hole or AdGuard Home. Both provide a web dashboard, a query log and blocklists. Optionally, Unbound sits behind them as a local recursive resolver that talks directly to root and authoritative servers.

Which homelab DNS setup should you choose?

Choose Pi-hole or AdGuard Home for filtering and local names, add Unbound only for local recursion, and use BIND only if you need a full authoritative server. For most homes, one filtering product is the whole setup.

OptionBest forEncrypted DNS built inLocal namesComplexity
Pi-holeHomelabs, Unbound pairing, large communityNo — needs Unbound or a proxyYes, Local DNS recordsLow
AdGuard HomeBeginners, families, encrypted DNS out of the boxYes — DoH, DoT, DoQYes, DNS rewritesLow
Pi-hole + UnboundPrivacy, DNSSEC, no public resolverVia Unbound recursionYesMedium
AdGuard + UnboundFiltering plus local recursionYesYesMedium
BIND / NSDFull authoritative zonesNoYes, zone filesHigh

Pi-hole v6, released in early 2025, folded its web interface and REST API into the main service and stores settings in a single file at /etc/pihole/pihole.toml. AdGuard Home is a single program with a polished interface, built-in encrypted DNS and a full DHCP server.

Do not overbuild. The common mistake is installing BIND, Unbound, Pi-hole and a private certificate authority on day one, then spending weeks debugging a setup that a single filtering resolver would have handled.

A layered homelab DNS guide explains the five layers and when each one is needed in the Big Iron homelab DNS strategy guide.

Rotten WiFi covers the practical home setup, including the fallback plan, in its guide to running your own DNS at home.

How does DNS flow in a homelab?

A client asks your homelab server, which checks its cache and blocklists, answers local names itself, and forwards everything else upstream — either to a public resolver or to Unbound, which then queries root and authoritative servers directly.

How a DNS query flows in your homelabYour devicelaptop, phone, TVPi-hole / AdGuard192.168.1.53 : 53Unbound (optional)127.0.0.1 : 5335Internet DNSroot + authoritativeasks fornas.homecache, blocklist,local recordsrecursive lookup,DNSSEC checkor public resolversuch as Quad9Local names are answered at home. Everything else goes upstream.
DNS flow: client to filtering resolver, optionally to Unbound, then to the internet. Illustration by Cysoro.

Split-horizon DNS is the name for this split: queries for your internal zone are answered locally, and everything else goes upstream. That is how nas.home can resolve at home while google.com still works normally.

Keeping the roles separate prevents confusion. A recursive resolver follows the DNS hierarchy, an authoritative server publishes records for zones you control, and a filtering resolver blocks known-bad domains. Pi-hole and AdGuard Home are filtering resolvers, not authoritative servers for the public internet.

How do you prepare the host?

Use an always-on host — a Raspberry Pi, mini-PC, NAS or virtual machine — running a supported Linux system, give it a fixed LAN address, update it, and plan what clients will use if it goes down.

  1. Pick the host: any always-on machine works. A Raspberry Pi is optional, not required.
  2. Fix the address: set a DHCP reservation in your router or a static address, for example 192.168.1.53, outside the DHCP pool.
  3. Update the system: run updates before installing DNS software, and keep it updated afterward.
  4. Plan the fallback: decide what happens if this host fails — a second server, or a quick router change back to public DNS.
  5. Note the admin ports: Pi-hole uses port 53 for DNS and its web interface, while AdGuard Home uses port 3000 for its first-time wizard.

Your DNS server is a single point of failure by design. Every device depends on it, so treat its uptime like you treat your router's uptime: keep it simple, keep it updated, and do not reboot it casually.

How do you install Pi-hole or AdGuard Home?

Install one of them with its official installer or Docker image, follow the setup wizard, choose an upstream resolver, and save the admin password. Always copy the install command from the project's own site, not from an old guide.

For Pi-hole, the official one-line installer is curl -sSL https://install.pi-hole.net | bash. It asks you to choose an upstream resolver such as Cloudflare, Google or Quad9 and a starter blocklist, and it shows an admin password at the end. Manage it afterward at http://pi.hole/admin or http://192.168.1.53/admin.

For AdGuard Home, the install script is curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v. Finish the setup wizard in your browser at http://192.168.1.53:3000. Both tools also publish official Docker images if you prefer containers.

If you pipe a script to bash, read it first or use the Docker image instead. That is a reasonable caution for any installer that runs as root on a machine that will hold your whole network's DNS.

Do not open port 53 to the internetBind DNS to your LAN address only. On Docker, publish port 53 bound to your LAN IP, not to all interfaces, or your server becomes a public open resolver.

How do you add local names for homelab services?

Add local records in Pi-hole under Settings, Local DNS, DNS Records, or in AdGuard Home under Filters, DNS rewrites. Each record maps a name to a LAN IP, so you can reach services by name instead of by number.

Use a real subdomain of a domain you own, such as homelab.example.com, rather than inventing a top-level domain. That avoids conflicts if that name later becomes real on the public internet.

Example records for a typical homelab:

  • nas.homelab.example.com — 192.168.1.10
  • jellyfin.homelab.example.com — 192.168.1.10
  • nextcloud.homelab.example.com — 192.168.1.10
  • pihole.homelab.example.com — 192.168.1.53

After adding a record, test it from a client with nslookup nas.homelab.example.com 192.168.1.53 or dig @192.168.1.53 nas.homelab.example.com. If it resolves, the record is live; if not, check that the client is actually using your server.

How do you point your network at the new DNS server?

Point your router's DHCP settings at the server, then renew leases or reconnect clients. Open the router's LAN, DHCP or Network Settings page, enter the resolver's fixed LAN address in the DNS-server fields, save, and reconnect your devices.

Most routers let you set one or two DNS servers. Put your homelab server first and, if you want a fallback, a public resolver second — but know that some clients will use the second server directly, bypassing your blocklists for those queries.

Some routers advertise themselves as the DNS server and forward queries onward. In that case, change the router's own upstream DNS to your homelab server, or disable that behavior if your router allows it. Verify afterward, not by guessing.

Test from a client with nslookup example.com and check that the server listed is your homelab IP. Then open the Pi-hole or AdGuard Home dashboard and confirm queries are arriving. You can also check your current DNS with our free DNS lookup tool.

How do you add Unbound for local recursion?

Install Unbound, configure it to listen on 127.0.0.1 port 5335, then point Pi-hole or AdGuard Home at it as the upstream. The common chain is client to Pi-hole or AdGuard Home, to Unbound, to root and authoritative servers.

On Debian or Ubuntu, install it with your package manager, then create a configuration that sets the interface to 127.0.0.1, port 5335, enables DNSSEC validation, hides the server identity, and allows only your LAN. Restart the service and test it with dig @127.0.0.1 -p 5335 example.com.

In Pi-hole, set the upstream to the custom address 127.0.0.1#5335 and uncheck the public resolvers. In AdGuard Home, put 127.0.0.1:5335 in the upstream DNS servers box and apply. Enable DNSSEC in whichever filtering tool you use.

Unbound adds privacy and independence, but it also adds a second service to maintain and a larger failure surface. Start without it, get the basic setup stable, and add it only when you have a clear reason.

What goes wrong, and how do you fix it?

The most common problems are clients still using the old DNS, a blocked domain that should be allowed, and a server that stops answering after a reboot. Each has a quick check.

Homelab DNS troubleshootingNo internet at allCheck the server is up, then set the router DNS back to public DNSSome devices still see adsThey may use hardcoded DNS — check nslookup and DHCP settingsA site is wrongly blockedFind it in the query log and allowlist the exact domainLocal name does not resolveCheck the record, then test with dig directly against the server
Troubleshooting: check the server, the client DNS setting, and the query log first. Illustration by Cysoro.
  • Flush DNS: after changing DHCP, reconnect the client or renew its lease so it picks up the new server.
  • Check the query log: it shows exactly which domains were blocked and why.
  • Allowlist carefully: allow the exact domain that broke a site, not a whole wildcard.
  • Watch for hardcoded DNS: some devices ignore DHCP DNS and use their own resolver; that traffic bypasses your server unless your router redirects it.

Secure your home network more broadly with our guide to how to secure your Wi-Fi, and keep your router firmware updated — a good DNS server cannot fix a router with known flaws.

The bottom line

Start with one filtering resolver, give it a fixed IP, add your local names, and point DHCP at it. Add Unbound later if you want local recursion.

Test every step with dig or nslookup, keep a fallback DNS plan, and never expose port 53 to the internet. You can verify your setup with the free DNS lookup tool.

Frequently asked questions

What is a homelab DNS server?

It is a DNS server you run on your own home network, usually on a Raspberry Pi, mini-PC, NAS or virtual machine. It answers DNS queries for your devices, can block ads and trackers, and can resolve local names such as nas.home for your own services.

Should I use Pi-hole or AdGuard Home?

Both do the core job well. Pi-hole has the largest community and pairs well with Unbound. AdGuard Home has encrypted DNS and a DHCP server built in, which makes it easier for beginners. Pick the one whose interface you prefer.

Do I need Unbound as well?

No. Most homelabs do not need Unbound. Add it only if you want your server to query root and authoritative servers directly, validate DNSSEC itself, and avoid sending all queries to one public resolver.

What IP address should my DNS server use?

Give it a fixed LAN address outside your router's DHCP pool, for example 192.168.1.53, using a DHCP reservation or a static configuration. Clients and your router need that address to stay the same.

What happens if my homelab DNS server goes down?

Every device that uses it loses name resolution, so websites stop loading even though the internet is up. Keep a fallback plan: a second DNS server, or a quick way to point your router back to your ISP or public DNS.

Is it safe to expose my DNS server to the internet?

No. A DNS server open to the internet becomes an open resolver that attackers abuse for amplification attacks. Bind it to your LAN only, and never forward port 53 from the internet to it.

Can a homelab DNS server block ads on all devices?

Yes, for ads served from known domains. It returns a blocked response for domains on a blocklist, so phones, TVs and consoles are covered without per-device software. It cannot block ads served from the same domain as the content.

Sources

  1. Big Iron — Homelab DNS Strategy: Split-Horizon, Internal CA, Blocking
  2. Rotten WiFi — How to Run Your Own DNS at Home: Pi-hole, AdGuard Home and Unbound
  3. Home Network Admin — How to Block Ads on Your Whole Network with Pi-hole (or AdGuard Home)
  4. Bitdoze — Pi-hole v6 vs AdGuard Home on Docker + Unbound (2026)
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against homelab DNS guides, Pi-hole and AdGuard Home documentation and Unbound setup guides.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free