I'm trying to set use my pihole/raspberry pi as a "local" DNS server, and have a fair number (25+) of "servers" inside my local network (behind a NetGear Orbi) that I'd like to reference by name.
I have them set up in /etc/hosts and things seem to work; but, I see there's a "Local DNS" option in the latest (5.2.1) UI; AND, there are three files in /etc/pihole that had entries in them (which I deleted to avoid confusing myself)
What's the "recommended/fastest/preferred" place to put and maintain my local hostnames and aliases? And what's the difference under "Local DNS" between "DNS Records" and "CNAME" records.
Your choice. The /etc/hosts and /etc/pihole/custom.list files are similar - each is a hosts file. The Local DNS records uses the latter and offers a web GUI interface. There is a heirarchy among the various local hosts files:
The priority is:
Configured in a config file in /etc/dnsmasq.d/
Read from /etc/hosts
Read from the list containing the device’s host name and pi.hole (stored in /etc/pihole/local.list )
Read from the “custom DNS” list (stored in /etc/pihole/custom.list )
Only the first record will trigger an address-to-name association.
A DNS record is a simple hosts association for a domain name to an IP.
CNAME uses the dnsmasq CNAME option as described here: