I have successfully set up Pi-Hole with my Google Wifi Router pointing to Pi-Hole as the DNS provider. I would like pi-hole to return a local ip address for some domains e.g
192.168.86.10 printer
192.168.86.11 plex
Does anyone know how to setup local dns entries? i've tried to apply the above in /etc/hosts but it does not work,.
in this case an entire wildcard domain but it doesn't have to be a whole domain. For simple single hostnames you most likely want to add in a new file specifying a custom addn-host file rather than modifying pi-hole's file directly.
Thanks for the reference. May i clarify where i can find " Edit the volume mounted directory / config"? I've currently installed Pihole using Docker on a Synology NAS. I can locate the Pihole /etc/dnsmasq.d/01-pihole.conf only after i enter:
sudo docker exec -it pihole bash
Can you advise a newbie like me which file i should edit and where?
It is recommended to volume map the /etc/dnsmasq.d and /etc/pihole folder from the inside of the container to your docker host (outside the container). Volumes are setup in your docker run configuration, usually with the style of <External Directory> to <Internal Directory> (dnsmasq.d). Ctrl+F Volume on this synology container knowledge base for an example of what volumes look like in synology. You want to make sure you have the following, update the synolgoy path on the left with whatever you want.
/some/synology/path/pihole -> /etc/pihole/
/some/synology/path/dnsmasq.d -> /etc/dnsmasq.d/
This helps persist any changes you make since it exists outside the conatiner & survives destroying the container and re-creating it with update image versions. Mapping the entire folder of dnsmasq.d makes it easy for you to add additional configuration files in it too. So you'd just create your new dnsmasq files in that volume mapped folder and restart the contianer.