Update DNS server notes

This commit is contained in:
Brad Treloar 2025-03-09 02:15:19 +10:30
parent ceda93a243
commit 275b488f25

View file

@ -17,23 +17,26 @@ running on raspberrypi.)
## Local DNS ## 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 ### 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 | | Domain | IP Address | Comment |
| :---------------- | :------------ | :---------- | | :--------------- | :------------ | :---------- |
| raspberrypi.local | 192.168.0.105 | raspberrypi | | raspberrypi.home | 192.168.0.105 | raspberrypi |
| homeoffice.local | 192.168.0.108 | homeoffice | | homeoffice.home | 192.168.0.108 | homeoffice |
### CNAME records ### 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 | | Domain | Target |
| :------------- | :---------------- | | :------------ | :---------------- |
| jellyfin.local | raspberrypi.local | | jellyfin.home | raspberrypi.local |
| notes.local | raspberrypi.local | | notes.home | raspberrypi.local |
## Groups ## Groups
@ -47,10 +50,48 @@ Emma
- No adlist? - No adlist?
- Whitelisted Google ad services anyway. - Whitelisted Google ad services anyway.
## Debugging ## Debugging DNS (from homeoffice)
### Server health check
Check Pi-hole's status: Check Pi-hole's status:
```bash ```bash
ssh raspberrypi
pihole status 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 <interface> | 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
```