Blackhole Advertising Sites with Pi-hole

Published: 2018-02-25
Last Updated: 2018-02-25 11:41:47 UTC
by Guy Bruneau (Version: 1)
5 comment(s)

A coworker told me a few weeks ago that he started using Pi-hole to block all advertising and that got me curious. I checked the hardware requirements and already had a server I could install this on. I used CentOS 7.4 as my platform but before starting, make sure selinux isn't running because it isn't supported (It is one of the checks the installation script does). To check execute:


If it return enabled change the configuration (see below) and reboot after it has been saved:

vi /etc/sysconfig/selinux, set selinux=disabled

Next make sure your server has a static address before running the installation and then you are ready to install.

I followed their recommended installation command: curl -sSL | bash [1] but you can also install everything manually by following the steps here as Method 1 or 2.

The installation was pretty straight forward and it checked for any missing packages and added them to the server. I answered a series of question to setup the Pi-hole DNS server. After the installation you need to point all your clients to your new DNS server (forward internal DNS server to Pi-hole) to take advantage of the blocking capabilities. If you setup the web interface you can login via http://IP/admin and login with the default password provided after the installation (the password can be changed at the command line with: sudo pihole -a -p) or view the statistics via the Dashboard provided by the web server.


Guy Bruneau IPSS Inc.
Twitter: GuyBruneau
gbruneau at isc dot sans dot edu

5 comment(s)


Thanks for the heads up on Pi-Hole!
As a long time (happy) user, I'd like to add 6 worthwhile features , as you can do much more than just ad-blocking:
1 - you can use pi-hole as your DHCP server and simply say to all your components will easily point to it as a DNS server;
2 - statistics, including Top Blocked Domains (to detect any wrong doings), and Top Clients (and you'll learn a lot on the behavior of some components on your network such as IoT, IP cameras, mobile phones...);
3 - in the "settings" / "Block lists" sub-menu,you can add any other third-party lists, including your own one based on your requirements;
4 - you can blacklist domains, sub-domains, and even entire Top Level Domains (g/cc/s/u-TLDs);
5 - you can define your upstream DNS servers such as OpenDNS, DNS.WATCH, Quad9... and add your own ones too to improve DNS neutrality and get around ISP DNS Hijacking;
6 - last but not least, using pi-hole as the DNS server for your proxies, or mail server will also prevent connecting or accessing unwanted domains/TLDs.
Have a look at the blog and the "What Really Happens On Your Network?" series of blog posts [1]: A lot to learn about strange, worrisome, or surprising behaviors on networks.

Just my 2 (€uro)cents

I'll echo what L0C4L says in the previous comment. Pi-hole is awesome. I've been using it for about 10 months now and will continue to do so. I'm running it on a BeagleBone Black using Debian Jessie. Yesterday was the first time I've ever had a problem, but that was fixed quickly by running a repair (pihole -r). The information you can get from the logging capabilities is amazing. The web interface is extremely helpful in figuring out any issues that may arise. Highly recommended!
what dns backend does pi-hole use? dnsmasq?
Right now, I do the same with unbound, but missing that nice statistics and graphs.
Yes, dnsmasq is the backend database
Will it be possible to install in WSL for windows 10? some time in the future ?

Diary Archives