Joshua Pack's Blog | The Forum | Hightek Designs | Donate

If you need an account, go to the forum and ask for it.

Skip to main content

DNS - Block Malware/Adult Content/Ads

This will not explain everything, however, I will try to go through as much as I can with this.


DNS is very important in connecting to a website. A Domain Name Server will take a domain name and then give back an IP, so your computer can connect to that server/website. A lot of domains are setup specifically for advertising, tracking, malware, adult content. This guide here is to show how you can take control of your internet connected devices.

Another concern is using the default DNS provided by your ISP. Your ISP will be able to know every website you access and sell that data to advertisers or whomever they want. This is a privacy risk.

I will explain 2 methods to help. One of which you can do RIGHT NOW. The other take a lot of setup to do. Family

This is the easy one. Go into your router and change your DNS settings to:


This will block Malware and Adult Content. This will also prevent ISP from seeing any DNS queries. However, we are now trusting Cloudflare with this information. They have said they do not track or sell that data.

For more help on getting this setup go here Router setup instructions · docs (



The first thing you need is a Raspberry Pi. You can buy one on Amazon for around $60/$70 for the board and a piSwitch. You can use these affiliated links below. I recommend the 4GB model, so that you can do other stuff with it.

  • Raspberry Pi 4 Kit (4GB):
    • Comes with everything you need, priced at $100
      • Raspberry Pi 4 4GB
      • 32GB Samsung EVO+ Micro SD Card (Class 10) Pre-loaded with NOOBS
      • USB MicroSD Card Reader
      • Raspberry Pi 4 Case with Integrated Fan Mount
      • Low Noise Bearing System Fan
      • 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter
      • PiSwitch (On/Off Power Switch)
      • Set of Heat Sinks
      • Micro HDMI to HDMI Cable - 6 foot
  • You could get the parts separately if you already have most of the stuff above:

I recommend at least the 4GB model, so you can also install and run some other programs for your home, such as Home Assistant.

Pi Setup:

If you bought the Kit, then you already have NOOBS installed! If you bought the SD Card separately, you will need to install NOOBS. You can find out how here: NOOBS - Raspberry Pi Documentation or you can watch this video

There are different ways of doing this, such as a headless setup. However, I do not want to show that. If you need that way of setting up your Pi, then I can always explain later.

I recommend connecting to the network using an ethernet cable and not wifi, however, wifi will work too.

There is no need to boot into desktop and I recommend NOOBS Lite. I nice video tutorial can be found here: Raspberry Pi OS Setup with SSH - YouTube She does very well in explaining everything you need in setting up SSH, so you can connect to the Pi from any computer on your network.

Please make note of your IP address. I would recommend setting the IP as static within your router. (Search for how to by your router model)

Connect to the pi using SSH. Once you get to this point, you are all setup and ready to install pi-hole!

Install Pi-Hole:

Now enter in these commands:

cd ~
curl -sSL | bash

The first command goes to your home directory, the second command installs pi-hole. Follow the on screen instructions. Note: do not install DHCP, we want your router to handle that.

You can now access your Pi-Hole admin by going here http://<IP_ADDPRESS_OF_YOUR_PI_HOLE>/admin/

Once there, go into Settings > DNS and change your Upstream DNS Servers to the and


Now go to Group Management > Adlists and add some of these lists, if you desire:

To find more you can subscribe to, you can go here: Blocklist Collection ¦ Firebog

Do note, that the more website you block the more of a possibility you can have false positives.

Once the installer has been run and you have made the necessary changes in admin, you will need to configure your router to have DHCP clients use Pi-hole as their DNS server which ensures that all devices connecting to your network will have content blocked without any further intervention.

Set your routers DNS to point to the static IP of your raspberry pi. Use the same IP for both fields.


You are all done. Now just wait for your devices to start pinging your Pi-Hole for DNS information. You can log into your admin page to see how many domains are being blocked!