Router Guides
Pi-Hole's blacklist configuration
10 min
overview pi hole is a very powerful tool that acts as a dns server with the ability to block advertising and tracking domains pi hole obtains lists of 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 their official website this guide explains how to extend the blacklists of pi hole with our cloud filtering in order to benefit from additional malware protection and content filtering features 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 navigating to your dashboard and accessing the networks section configuration methods the setup 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 personal preferences and the type of installation you have done if you decide to configure via the web interface, follow the first section below otherwise, skip to the command line instructions configuration through web interface access the web interface log in to your pi hole admin dashboard from the main panel, go inside the settings menu and move to the dns tab set up upstream dns servers 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 enter our custom ip addresses in the ipv4 custom fields as follows custom 1 ipv4 185 236 104 104 custom 2 ipv4 185 236 105 105 save and verify scroll to the bottom of the page and click the save button to apply your changes you should now have your pi hole server properly configured to forward all client requests to our dns servers to start using our blacklists for content filtering and malware protection, you must now configure your specific filtering policies by going to the protection section of our cloud dashboard switch configuration file via cli if for some reason you do not 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 that if you have already completed the web interface setup above, you do not need to proceed with this section locate the configuration file the file we are interested in is called setupvars conf and by default is located inside the /etc/pihole/ folder move to that directory and open the file with your preferred text editor sudo nano /etc/pihole/setupvars conf this file is basically a script that takes care of setting numerous variables, which will then be used by pi hole when running its core services edit the dns variables the variables we need to change are the ones defining the upstream dns if you have not previously configured an upstream dns server, you might not find these variables in the file in that case, you can directly add two new variables called pihole dns 1 and pihole dns 2 to the file set their values to our correct ip addresses as shown below if they already exist, simply update their values routeros pihole dns 1=185 236 104 104 pihole dns 2=185 236 105 105 save and close the file once you are done 3\ apply changes and restart services run the reconfiguration command in your shell to apply the new values routeros pihole r finally, we need to restart the dns service to make sure everything is running smoothly you can use the following command to do this routeros sudo service dnsmasq restart we are done 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 your filtering policies by going to the protection section of our cloud dashboard