diff --git a/docs/home-network/services/pi-hole-dns-server.md b/docs/home-network/services/pi-hole-dns-server.md index f8b5be7..e7dadad 100644 --- a/docs/home-network/services/pi-hole-dns-server.md +++ b/docs/home-network/services/pi-hole-dns-server.md @@ -17,23 +17,26 @@ running on raspberrypi.) ## Local DNS +Local network domains use `.home` instead of `.local` because `.local` collides +with device's built-in systems for resolving `.local` domains automagically. + ### A records -Local A records map machine domain names to their IP address. +`.home` A records map machine domain names to their IP address. -| Domain | IP Address | Comment | -| :---------------- | :------------ | :---------- | -| raspberrypi.local | 192.168.0.105 | raspberrypi | -| homeoffice.local | 192.168.0.108 | homeoffice | +| Domain | IP Address | Comment | +| :--------------- | :------------ | :---------- | +| raspberrypi.home | 192.168.0.105 | raspberrypi | +| homeoffice.home | 192.168.0.108 | homeoffice | ### CNAME records -Local CNAME records map service domain names to their machine's domain name. +`.home` CNAME records map service domain names to their machine's domain name. -| Domain | Target | -| :------------- | :---------------- | -| jellyfin.local | raspberrypi.local | -| notes.local | raspberrypi.local | +| Domain | Target | +| :------------ | :---------------- | +| jellyfin.home | raspberrypi.local | +| notes.home | raspberrypi.local | ## Groups @@ -47,10 +50,48 @@ Emma - No adlist? - Whitelisted Google ad services anyway. -## Debugging +## Debugging DNS (from homeoffice) + +### Server health check Check Pi-hole's status: ```bash +ssh raspberrypi pihole status ``` + +### Client health check + +Confirm that the network interface controller is using the expected DNS server: + +```bash +# List interfaces to find ethernet or wi-fi controller. +nmcli | grep ": connected to" + +# Show the DNS servers used by the controller. +nmcli device show | grep DNS +``` + +Restart the name resolution service: + +```bash +sudo systemctl restart systemd-resolved +``` + +## How Linux machines choose a DNS server + +### When using DHCP + +DNS servers are determined by `/etc/dhcpcd.conf`: + +```bash +# Get the DNS servers list from the DHCP server, which is usually on the router. +option domain_name_servers + +# Or, set a list of DNS servers explicitly. +# e.g. +# - 1.1.1.1 Cloudflare +# - 192.168.0.1 LAN Router +static domain_name_servers=1.1.1.1,192.168.0.1 +```