«

»

Jan 16

Use PiHole to resolve local DNS

dnsmasq will read any file in dnsmasq.d as a configuration file; this is how Pi-hole works too. The file (02-mydns.conf) you’ve added tells dnsmasq where to find another hosts file (hosts.mydomain).

This will survive installs and updates by the Pi-Hole curl script. Anytime you update your hosts.mydomain file you will need to restart dnsmasq for changes to take effect. You can name the hosts file and the conf file to whatever you’d like.

 

Use PiHole to resolve local DNS

Create a new hosts file
sudo nano /etc/hosts.mydomain

Add IP addresses followed by the local hostname you’d like to resolve, one per line. Write out and exit.
192.168.0.010 sprinklers
192.168.0.011 server

Create a new dnsmasq conf file
sudo nano /etc/dnsmasq.d/02-mydns.conf

Add one line of code to the file
addn-hosts=/etc/hosts.mydomain Write out and exit.

Restart dnsmasq
sudo service dnsmasq restart

 

Borrowed from here. Thank you.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>