← Back to infra overview

Local DNS

The homelab uses Pi-hole as its primary DNS resolver, but a flat with servers, containers and smart-home devices needs more than ad blocking. A second resolver, CoreDNS, answers a private local domain so services can be reached by name instead of IP. Both layers are fed by fritz-lan-dns, my own service that collects mesh and host data from the FRITZ!Box, stores it in SQLite, and generates DNS records from it.

Why a second DNS layer

Query flow

Pi-hole answers everything it normally answers and conditionally forwards only the private local domain to CoreDNS:

Client -> Pi-hole -> conditional forward for the local domain
                 -> CoreDNS
                    |- known host from dns/hosts -> answer
                    `- unknown name -> FRITZ!Box fallback -> answer rewritten to the local domain

CoreDNS runs on the same Proxmox host as Pi-hole and only answers the local domain. The fallback keeps names working even before they appear in the generated host list.

Collecting host data

OpenWrt as a second source

Devices that only exist behind the OpenWrt router can be added as a second host source. The service reads DHCP leases and static hosts over ubus, so those devices also resolve under the local domain instead of being invisible to the FRITZ!Box.

Safety model

Where it runs

Pi-hole runs as a lean LXC container on the main Proxmox host. CoreDNS and fritz-lan-dns run as Docker containers on the primary Docker host. See the fritz-lan-dns repository for configuration details.

IP addresses, the actual local domain and credentials are intentionally left out of this page.