U2 Networking

DNS, domains and certificates without the drama

There is an old joke among administrators that the cause of any outage is DNS. It is funny because it is often true. Keep your name resolution simple, own your domain, and let automation handle certificates.

At a glance

  • Use the resolver built into your firewall unless you have a specific reason not to. Every extra DNS server is one more thing that can break name resolution for the whole house.
  • Name internal hosts under a subdomain of a domain you own, such as lab.example.net. Avoid invented top-level domains.
  • Own a domain. It makes email portable, certificates easy and remote access tidy. Do not run your own mail server.
  • Get certificates automatically with the ACME protocol. DNS validation lets you issue certificates for internal services without exposing them.
  • Blocking newly registered domains is the single most valuable DNS filtering feature.

How name resolution flows at home

When a laptop looks up a name, it asks the resolver it was given by DHCP. In a well-built homelab that resolver is the firewall, which answers from local records for your own hosts and from its cache or upstream servers for everything else.

  1. Clients ask the firewall. DHCP on each network hands out the firewall's address on that network as the DNS server.
  2. The firewall answers local names from static entries and DHCP registrations, such as nas01.lab.example.net.
  3. Everything else is resolved upstream, either by full recursion from the root servers or by forwarding to a public resolver.
  4. Answers are cached for their time-to-live, so repeated lookups are fast.

This design has one resolver per network, one place to add records and one place to look when something fails. It is boring, which is exactly what you want from DNS.

Myth

"A serious homelab needs split-horizon DNS, multiple resolvers and zone transfers." Most do not. Complex DNS designs are a common source of outages that are very hard to diagnose. Add complexity only when you can name the problem it solves.

Choosing an upstream

You can let the firewall resolve names itself from the root servers, or forward queries to a public resolver. Both are reasonable. Full recursion means no single company sees all your queries, at the cost of slightly slower first lookups. Forwarding to a public resolver that requires no account and offers malware blocking is a sensible default for most homes.

Encrypted DNS between your firewall and the upstream hides queries from your provider. It is worth enabling if your firewall supports it, but do not spend weeks comparing protocols. Privacy is decided far more by where your data lives than by which DNS service you use.

Naming your internal hosts

Pick a proper internal domain

Use a subdomain of a domain you own, such as lab.example.net or home.example.net. This guarantees nobody else on the internet uses the same names, and it lets you obtain trusted certificates for internal services later.

  • Avoid invented suffixes such as .lan. They are not reserved, and software treats unknown suffixes inconsistently.
  • Avoid .local for unicast DNS. It is reserved for multicast discovery, and devices treat it differently.
  • home.arpa and .internal are reserved for private networks and are valid choices if you do not own a domain, but you cannot get publicly trusted certificates for either.

Use a naming convention

Short, role-based names age better than clever ones. A pattern like role plus number is easy to read in logs and to automate.

NameAddressRole
fw01.lab.example.net10.42.10.1Firewall, management interface
sw01.lab.example.net10.42.10.2Core switch
hv01.lab.example.net10.42.10.11Hypervisor host 1, management
nas01.lab.example.net10.42.30.10NAS, file services
hub01.lab.example.net10.42.30.20Home automation hub

Give servers static DHCP reservations or static addresses, and create matching DNS records in the same place. Record every assignment in your documentation.

DNS filtering

A DNS sinkhole answers lookups for known advertising, tracking and malware domains with a dead end. It protects every device on the network, including ones where you cannot install software. You can run it on the firewall as a package or on a small dedicated machine or container.

  • Start with conservative block lists. Aggressive lists break websites, apps and payment pages, and the household will notice before you do.
  • Keep an allowlist and a quick way to pause filtering.
  • Block newly registered domains where your tools support it. Phishing and malware campaigns rely heavily on fresh domains, and legitimate sites rarely need to be reached on their first days.
  • Allow every internal network to use the resolver. A forgotten VLAN that cannot resolve names looks like a broken internet connection.
  • Redirect stray DNS. A firewall rule can redirect plain DNS sent to outside servers back to your resolver. Devices with built-in encrypted DNS will still bypass it, so treat filtering as a layer, not a guarantee.

Caution

If your DNS filter runs on a separate machine, every network depends on it. Snapshot or back it up before changes, and keep a documented way to switch clients back to the firewall's resolver if it fails. An outage of the filter is an outage of the internet for everyone in the house.

Own your domain

A domain costs a small amount each year and pays for itself many times over. It gives you portable email addresses, clean names for remote access and the ability to issue trusted certificates. Choose a registrar for its support, security record and features rather than for the lowest price:

  • Strong multi-factor authentication on the registrar account.
  • Registrar lock and automatic renewal, so the domain cannot be stolen or lapse.
  • A DNS service with an API, which you will want for certificate automation.
  • Responsive human support for the day you need help with something unusual.

Email: own the domain, rent the mailbox

Running your own mail server from home is a losing battle. Residential addresses are widely blocked by receiving servers, deliverability requires constant care, and mail servers are a frequent target for attacks. Use a hosted mailbox with your own domain. If you change providers, your address stays the same. For alerts from lab systems, use the hosted provider's authenticated sending or a relay service rather than sending directly from home.

Changing home addresses

If your home address changes, a dynamic DNS client can keep a record up to date. Point a friendly name in your own domain at the dynamic record with a CNAME, so you can switch dynamic DNS providers without changing anything that depends on the name.

Certificates for internal services

Browser warnings on internal services train everyone in the house to click through warnings. Valid certificates are free and can be fully automated with the ACME protocol. Publicly trusted certificates now have short lifetimes, typically 90 days or less, and the industry is moving toward shorter ones still, so automation is the only sane approach.

HTTP validation

  • The certificate authority fetches a file from your server over port 80.
  • Requires the service to be reachable from the internet.
  • Fine for public services; unsuitable for internal ones.

DNS validation

  • Your ACME client creates a temporary TXT record through your DNS provider's API.
  • Nothing needs to be reachable from the internet.
  • Works for internal names and wildcard certificates.

DNS validation needs an API token for your DNS provider. Scope it as narrowly as the provider allows, ideally to editing TXT records in a single zone, and store it as a secret, never in a public repository.

Rule of thumb

Every publicly trusted certificate is recorded in public certificate transparency logs, including its hostnames. If you would rather not publish the names of your internal services, use a wildcard certificate such as *.lab.example.net on your reverse proxy instead of one certificate per host.

Reverse proxies tie it together

A reverse proxy receives web requests, chooses the right backend by hostname and handles TLS in one place. With one in your lab:

  • One wildcard certificate covers every internal web service.
  • Services can listen only on localhost or the lab network, with the proxy as the single entry point.
  • You can add authentication in front of applications that have weak or no login of their own.
  • Firewall rules become simpler, because only the proxy needs to reach most backends.

Reverse proxies can run as a package on the firewall, in a container next to your services, or on a small virtual machine. Pick the location you will maintain most reliably. Using one to publish services to the internet is a separate decision with its own risks; see Remote Access and VPNs.

For a rarely used administrative interface on your management network, a self-signed certificate that you have verified once is an acceptable compromise. For anything the household uses, issue a real certificate.