Quick steps to configure local DNS with Pi-hole.
1. Login into the Pi-hole server.
I am using portainer so it will look like this:
2. Execute the following commands:
Go to the following directory "/etc/dnsmasq.d".
command:
cd /etc/dnsmasq.d
Create the following file "02-lan.conf" with the following line added "addn-hosts=/etc/pihole/lan.list"
command:
echo "addn-hosts=/etc/pihole/lan.list" > ./02-lan.conf
Go to the directory "/etc/pihole".
command:
cd /etc/pihole
Create the following file "lan.list". And add the dns entries for your lan my example.
command:
vim lan.list (or use the editor of your choise)
The entries made. The format is "IP <TAB> name1 <TAB> name2 ...".
192.168.0.1 router.lan
192.168.0.10 nas.lan
192.168.0.11 plex.lan
192.168.0.12 docker.lan portainer.lan
Quit and save .
press "ESC" followed by ":wq" "ENTER"
Execute the following command.
command:
pihole restartdns reload
3. Test your configuration.
with a bowser:
or command prompt:
Comments
Post a Comment