With the update to V5, there is a file already installed to accept domain/ip addresses.
It is located at /etc/pihole/custom.list.
Be careful when adding entries. NO TABS or Multiple spaces or just the hostname.
Normally, a hosts file would look like:
192.168.1.100 ctrl.example.com ctrl
But in the custom.list file, it MUST look like:
When they are entered correctly, well... they work but they will also display in the Web Interface.
If you don't see them there, you didn't enter them correctly.
Ignore the instructions below this line. They are no longer needed.
I copied these instructions from somewhere (I really don't remember) but they do work.
ssh into PiHole
echo "addn-hosts=/etc/pihole/lan.list" | sudo tee /etc/dnsmasq.d/02-lan.conf
Create a “hosts file” in /etc/pihole/lan.list with the format ipaddress fqdn hostname.
substituting “your.lan” for whatever you want your domain name to be.
And remember, thanks to Google buying the ".dev" TLD, you can't use that for your local domains anymore.
sudo pihole restartdns to restart the DNS server.