This is an old revision of the document!
Using Pi-Hole to Create Local DNS Entries
1. ssh to your pi-hole server
2. use nano to edit the dnsmasq:
sudo nano /etc/dnsmasq.d/05-custom.conf
3. add the dns entry in the following format:
address=/example.com/1.2.3.4
some examples from my network:
address=/violet-fw-01.violet.com/192.168.1.1
address=/violet-nas-01.violet.com/192.168.1.38
4. restart the dnsmasq service:
service dnsmasq restart
If you want to create cnames, you can utilize the same method, the config file does not care how many hostnames point to the same IP:
#cnames
address=/firewall.violet.com/192.168.1.1
address=/nas.violet.com/192.168.1.38
This is especially useful if you have a proxy server, as you can direct multiple hostnames to the proxy server's IP, and use the proxy server to forward it to the correct port. For example, plex, radarr, nzbget, etc all reside on a ubuntu VM ending in .27, but utilize different ports to be accessed from browser. .40 is my proxy server:
#reverse proxy pre-requisites
address=/plex.violet.com/192.168.1.40
address=/radarr.violet.com/192.168.1.40
address=/sonarr.violet.com/192.168.1.40
address=/lidarr.violet.com/192.168.1.40
address=/nzbget.violet.com/192.168.1.40

Discussion