🔌 Router Guides
Pi-Hole's blacklist configuration
3min
1 1 how to extend pi hole blacklist for internet dns filtering pi hole is a very powerful tool that acts as a dns server with the ability to block advertising and tracking domains (tracking domains) pi hole obtains lists of advertising and tracking domains from a configurable blacklist of predefined sources , and then compares dns queries against them however, although its main purpose is to work as an ad blocker, the nature of pi hole actually allows it to block the domain of any website by manually adding the domain name to a blacklist for more information on how pi hole works, visit the official website official website this guide explains how to extend pi hole's blacklists with our blacklists in order to benefit from additional malware protection and content filtering features please note(1) before proceeding with this guide, you must register your public ip address only registered ip addresses can use the malware protection and content filtering features on their network you can do this by going here here and then accessing the networks section please note(2) the configuration process described in this guide can be done either through the web interface or by manually editing the configuration files you can decide which one to use based on your preferences (and the type of installation you have done) if you decide for configuration via web interface, you have to follow the first paragraph of the guide otherwise, the second one is the one for you 2 2 configuration through web interface 2 1 2 1 web interface access from here, go inside the settings menu and move to the dns tab 2 2 2 2 here you need to enter the ip addresses of the upstream dns servers you want to set up these are the servers to which all requests will be automatically forwarded by your pi hole server in this case, the ip addresses you need to enter in the ipv4 custom fields are as follows, as shown in the image below 2 3 2 3 click the save button to save your changes and that's it! you should now have your pi hole server properly configured to forward all client requests to our dns servers 2 4 2 4 to start using our blacklists for content filtering and malware protection you must now configure them you can do this by simply going to our site and here here in the protection section 3 3 switch configuration file if for some reason you don't want to use the web interface (or have simply decided not to install it), you can alternatively edit the pi hole configuration files manually by following these simple steps please note if you have already completed all the steps described in the previous part of this guide, you do not need to proceed with the next part 3 1 3 1 the file we are interested in is called setupvars conf and by default is located inside the /etc/pihole/ folder move now to that folder and open the file with any text editor 3 2 3 2 the file is basically a script that takes care of setting numerous variables, which will then be used by pi hole when running the various scripts if you edit this file manually and then run the pihole r command , the new values you set will be applied once the file is open, it should look approximately like this 3 3 3 3 the variables we need to change are the ones called pihole dns , that is, the ones highlighted by the arrows in the image above if you have not previously configured an upstream dns server, you should not find any of these variables in the file in that case you can directly add two new variables called pihole dns 1 and pihole dns 2 respectively to the file and then set their values to the correct ip addresses, as shown in the image below otherwise, simply change these two variables by setting the desired values 3 4 3 4 save and close the file then run the pihole r command in a command shell to apply the changes 3 5 3 5 finally, we need to restart the dns service you can use the following command to do this sudo service dnsmasq restart 3 6 3 6 we are done and you should now have your pi hole server properly configured to forward all client requests to our dns servers what remains to be done now is to configure our blacklists you can do this by going to our site and then to the protection section other ways to ask » » how to configure pi hole blacklists for internet dns filtering » » configuring pi hole blacklists for internet dns filtering how to