DNS and name resolution

This page tells you how names resolve inside and outside the homelab. It also tells you where to add a new name. The DNS layer caused a full evening of confusion once ( 2026-11-30 ). The design below is the verified state.

The design: split-horizon

The internal zone homelab.fredcorp.cc and its subzone bigboii.homelab.fredcorp.cc exist only on the FreeIPA DNS server. That server is the gatekeeper at 10.254.0.1. The internal zone is not published to the world.

The public zone fredcorp.cc at OVH holds two kinds of records:

  1. The jumpto and docs DynHost records. They point at the current WAN address ( the bastion on port 2222, the docs site on 80/443 via the reverse proxy ). The ovh-dynhost role ( site-dns.yml ) creates them at OVH via the API; the ovh-ddns timer keeps them current.
  2. Public PLACEHOLDER records, one per host that must be reachable off-site. They all point at 10.254.0.1. This is an RFC1918 address. It routes nothing from the internet. The ovh-dns role creates and keeps them. The name list is ovh_public_names in group_vars/all/main.yml.

No real internal address is public.

Two consequences you will meet in practice:

  1. A public resolver answers with the placeholder value for an internal name. It answers NXDOMAIN for a name that has no record, for example a brand-new host.
  2. A LAN client that does not use the gatekeeper as its resolver gets NXDOMAIN for every internal name. Its connections fail with curl 000 or ssh: could not resolve hostname. Other machines work fine. Check the client resolver first.

Who resolves what

Client Resolver Internal names resolve?
LAN client ( DHCP ) 10.254.0.1, handed out by UniFi DHCP yes
External name, any LAN client gatekeeper -> PiHole ( 10.0.0.2 ) -> public no internal names involved
LAN client behind PiHole PiHole, with a conditional forward to 10.254.0.1 yes ( forwarded )
macOS workstation /etc/resolver/homelab.fredcorp.cc points at 10.254.0.1 yes
Off-site client public resolvers placeholder value only, for names on the public list

The forwarder chain ( verified 2026-12-02 )

External names flow: client -> FreeIPA ( forwarders = PiHole 10.0.0.2 ) -> public resolvers. Ad blocking therefore applies to the whole lab without any client-side setting. There is no loop: FreeIPA answers the internal zones authoritatively and never forwards them, so the PiHole never sees an internal query from the gatekeeper and nothing bounces between the two servers.

The PiHole conditional forward

Clients that use PiHole ( 10.0.0.2 ) lose the zone without a forward. On the PiHole host, create /etc/dnsmasq.d/99-homelab-forward.conf:

server=/homelab.fredcorp.cc/10.254.0.1

Then run pihole restartdns. TODO: fold this into a small dns-forward role when NetworkSentinel joins the inventory.

The macOS resolver

sudo tee /etc/resolver/homelab.fredcorp.cc >/dev/null <<EOF
nameserver 10.254.0.1
EOF

This rule covers every *.homelab name. No per-host entry is needed. Remove any bootstrap-era 10.254.0.1 lines from /etc/hosts afterwards. The resolver file makes them redundant.

The public side: one real record, placeholders for the rest

Off-site, ssh must resolve the target name before it can evaluate its client configuration. The placeholder records give it an answer. The address they return is never a local network, so the client's Match !localnetwork ... rule ( see SSH from outside ) starts the jump. The bastion then resolves the real name on the inside and routes the connection to the true host.

On the LAN, the internal resolver answers first. It returns the real addresses. The connection stays direct.

One detail, verified 2026-12-02: with ProxyJump, the client hands the NAME STRING of the destination to the bastion. The bastion resolves the name. The client resolves the name only for its own configuration checks. The placeholder satisfies the client side. The bastion does the real resolution.

Why per-name records and not one wildcard: the OVH zone API answers "Invalid domain name" to a record with subDomain *.homelab ( tried 2026-12-02 ). Explicit records with multi-label subDomains are accepted. The same zone already holds _acme-challenge.homelab from the DNS-01 workflow.

Adding a name

For an INTERNAL name, add an explicit record to dns_records in homelab-ansible/group_vars/all/main.yml. Then run:

ansible-playbook -i inventory/hosts.ini site-dns.yml --vault-password-file .vault-pass

Enrolled hosts get their own A record during enrollment. The ipa-client role creates it. dns_records is for aliases and extra names.

For OFF-SITE reachability, add the name to ovh_public_names in the same file, then run site-dns.yml again. The ovh-dns role creates the placeholder record at OVH.

The OVH side of the parent zone

homelab.fredcorp.cc is not a zone at OVH. The parent zone fredcorp.cc holds:

  • the jumpto and docs DynHost records,
  • the transient _acme-challenge.homelab TXT used by DNS-01 ( see Certificates ),
  • the public placeholder records from ovh_public_names.

Troubleshooting, by symptom

  • Internal names resolve to the placeholder value ( 10.254.0.1 ) or come back empty for EVERY client, while dig @10.254.0.1 answers correctly: a UniFi Threat Management Content Filter ( Ad Block ) is hijacking the DNS. It DNATs every port 53 packet from the filtered network to its own resolver on the gateway, whatever DHCP advertises, so FreeIPA is bypassed. Check ipset list dnsfilter on the gateway console. This fault was found and removed on 2026-12-02 ( the set held 10.0.0.0/12 ). Ad blocking belongs in the PiHole, reached through the forwarders above, never in the UniFi Content Filter.
  • curl 000 for an internal name from ONE machine only: that machine does not use the gatekeeper or the PiHole forward. Check its resolver before you touch anything else.
  • dig works against the server but not from a client: the forward chain is broken, not the zone.
  • NXDOMAIN from everywhere, including the LAN: the FreeIPA DNS service is down. Check systemctl status named-pkcs11 on the gatekeeper. This is what a wedged boot looks like ( 2026-11-30 ).
  • NXDOMAIN off-site for a NEW host: the name is not in ovh_public_names yet. Add it and run site-dns.yml.