DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Data Engineering
  3. IoT
  4. Toolsmith Snapshot: Ad Blocking With Pi Hole

Toolsmith Snapshot: Ad Blocking With Pi Hole

Learn more about using Pi-hole for ad blocking!

Russ McRee user avatar by
Russ McRee
CORE ·
Feb. 25, 19 · Tutorial
Like (6)
Save
Tweet
Share
6.53K Views

Join the DZone community and get the full member experience.

Join For Free

Pi-hole is a DNS sinkhole that protects your devices from unwanted content, without installing any client-side software.

Pi-hole Overview

From the Pi-hole overview:

  • Easy-to-install: versatile installer, takes less than ten minutes
  • Resolute: content is blocked in non-browser locations, such as ad-laden mobile apps and smart TVs
  • Responsive: speeds up browsing by caching DNS queries
  • Lightweight: runs smoothly with minimal hardware and software requirements
  • Robust: command line interface quality assured for interoperability
  • Insightful: responsive Web Interface dashboard to view and control Pi-hole
  • Versatile: optionally functions as DHCP server, ensuring all your devices are protected automatically
  • Scalable: capable of handling hundreds of millions of queries when it is installed on server-grade hardware
  • Modern: blocks ads over both IPv4 and IPv6
  • Free: open source software

Important Note: This information is from docs.pi-hole.net.

  • The Pi-hole setup offers eight options for an upstream DNS Provider during the initial setup.
  • Utilize the Pi-hole command line interface with ease.
  • Pi-hole includes a caching and forwarding DNS server, now known as FTLDNS. After applying the blocking lists, it forwards requests made by the clients to configured upstream DNS server(s).
  • Updating is as simple as running the following command:
    pihole -up

Pi-hole Installation

I installed Pi-hole on a Raspberry Pi 2 Model B running Raspbian Stretch (Novemver 2018, 4.14 kernel).


Figure 1: Pi-hole on Raspberry Pi 2 Model B

There is a one-step automated installation method for those who want to get started quickly and conveniently. You can use the following command:

curl -sSL https://install.pi-hole.net | bash


There are alternative installation methods if you’re not comfortable piping to bash.

Piloting Pi-hole

Once you’ve completed installation, browse to the IP address you established during setup. After running Pi-hole for even a few hours, it will begin to serve you as designed, and well at that.


Figure 2: Pi-hole at work

Take note of the fact that 17.9 percent of traffic and 532 specific queries. Pi-hole’s Gravity script is key here: “Gravity is one of the most important scripts of Pi-hole. Its main purpose is to retrieve blocklists, and then consolidate them into one unique list for the built-in DNS server to use, but it also serves to complete the process of manual whitelisting, blacklisting, and wildcard update. It is run automatically each week, but it can be invoked manually at any time.”

As seen in Figure 3, Pi-hole takes exception to a number of:

Figure 2: Pi-hole blocks

192.168.248.12 is my iPhone on my local network. You can see that between Apple, Microsoft, and other domains there’s more than a bit of content in their ad streams that is flagged as less than desirable via Pi-hole’s Block Lists.

Enjoy the use and benefits of Pi-hole; I’d really like to hear your success stories and how you’re running Pi-hole (what hardware platforms?). Let me know via Twitter or in the comments below.

Until next time, cheers!

ADS (motorcycle) Blocking (computing) raspberry pi Command-line interface Snapshot (computer storage)

Published at DZone with permission of Russ McRee, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Spring Cloud
  • Apache Kafka Is NOT Real Real-Time Data Streaming!
  • Practical Example of Using CSS Layer
  • 10 Easy Steps To Start Using Git and GitHub

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: