---
title: Pi-Hole's blacklist configuration
slug: legacy/pi-holes-blacklist-configuration
description: Enhance your Pi-hole’s ad-blocking and tracking protection with our comprehensive guide. Learn how to extend your blacklist by adding new sources for better malware protection and content filtering.
docTags: 
createdAt: 2024-01-19T15:52:58.096Z
---

## 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&#x20;*(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*.&#x20;

***

***>> >> platform is totally in Cloud and easy to activate &#x20;***[<font color="#ff361d">***Request a quotation***</font>](https://flashstart.com/landing-get-quote)***&#x20;or&#x20;***

***

<font color="#000000">For more information on how Pi-Hole works, visit the .</font>
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<font color="#000000"> </font> 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.

***

***>> platform protects you from a vast gamma of threats and blocks the access to damaging sites ?&#x20;***[<font color="#ff361d">***Request a quotation***</font>](https://flashstart.com/landing-get-quote)***&#x20;or&#x20;***

***

## Configuration through Web Interface

Web Interface Access

From here, go inside the *Settings menu* and move to the *DNS tab*.

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 :

::Image[]{src="https://api.archbee.com/api/optimize/qeNTDI134aDAkmAtZMoNc/yrvCbbvCm4nwIHK6lZuPi_image.png" size="50" width="747" height="554" position="center" caption="isP4 custom Insert " alt="Entering the correct ipv4 DNS" darkWidth="747" darkHeight="554" showCaption="true"}

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.

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<font color="#000000"> </font> in the **Protection section**.

***

***>> Protect your network with advanced video and DNS content filtering&#x20;***[<font color="#ff361d">***Request a quotation***</font>](https://flashstart.com/landing-get-quote)***&#x20;or&#x20;***

***

## Switch Configuration File

If for some reason you don't want to use the web interface (or have simply decided not to install it),&#x20;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.

The file we are interested in is called *setupVars.conf* and by default is located insid&#x65;*&#x20;the /etc/pihole/ folder*.
Move now to that folder and *open the file with any text editor*.

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:

::Image[]{src="https://api.archbee.com/api/optimize/qeNTDI134aDAkmAtZMoNc/DEMnqxnSyDWtbkzrwCv9g_image.png" size="50" width="687" height="442" position="center" caption="Configuration change scripts" alt="Changing the correct DNS through text editor" darkWidth="687" darkHeight="442" showCaption="true"}



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:

::Image[]{src="https://api.archbee.com/api/optimize/qeNTDI134aDAkmAtZMoNc/LSsdb_XupbuPcoRV7RPSS_image.png" size="50" width="246" height="58" position="center" caption="Changing the right variables" alt="Correcting PIHOLE_DNS variables with the correct ip's" darkWidth="246" darkHeight="58" showCaption="true"}



Otherwise, simply change these two variables by setting the desired values.
&#x20;
Save and close the file. Then run the *pihole -r command* in a command shell to apply the changes.

Finally, we need to restart the **DNS service**.
You can use the following command to do this:
*sudo service dnsmasq restart*

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.

