Last edited: 2025-05-18 19:09:22
Blocking and filtering porn, adult content and other inappropriate websites for parental control could seem a bit technical and difficult. In this tutorial, I will walk through how to do it on your home network using AdGuard Home.
The method/software we will be using to filter your home network's traffic is called AdGuard Home, which is a free software. AdGuard Home is a network-wide ad and tracker blocking solution that operates at the DNS level. Here's a quick overview:
It functions as a DNS server that filters out ads, trackers, and malicious domains before they reach any of your devices
Works across your entire home network, protecting all connected devices without installing individual software on each one
Open-source software that can be self-hosted on various hardware (Raspberry Pi, old computer, NAS, etc.)
Features a web interface for monitoring network activity and customizing blocking rules
Supports modern DNS protocols like DNS-over-HTTPS (DoH), DNS-over-TLS (DoT), and DNS-over-QUIC (DoQ)
Allows for custom blocklists and whitelists to personalize your filtering
Provides parental controls through domain blocking
Offers privacy benefits by preventing DNS requests from being tracked by your ISP
AdGuard Home is particularly popular among privacy-focused users and those looking to reduce ads and do parental control across all their home devices with a single installation.
The hardware I will be using for this tutorial is the Raspberry Pi 5. But like mentioned above, you can use things like an old computer, but I like the Raspberry Pi because it is a small and sleek solution, and thus does not take up space, as you will most likely have it placed beside your home router. If you do not already have a Raspberry Pi lying around, I suggest you buy the following:
HDMI to micro HDMI adapter (the Raspberry Pi 5 does not have a regular HDMI port, but the micro one)
SD Card reader (if your computer does not have one)
We can move on to the installation when you have gathered all the hardware.
Before we even get to installing AdGuard Home, we need to install the operating system for the Raspberry Pi. Go to Raspberry Pi’s official website and download their Imager. Once that is downloaded and installed on your computer, open it up and plug in the micro-SD card into your computer and choose which Raspberry Pi device you have, what operating system, and then the SD card which should be showing in the storage option:
You will get prompted if you want to apply custom settings, but for the sake of simplicity, let’s just go with the default settings. Once the OS installation is finished, you can plug the SD card into your Raspberry Pi. Plug in a screen, keyboard, mouse, and power cable to the Raspberry Pi. Also, connect it via Ethernet to your router. Just go through the steps on which language to use, username (I choose “pi”) and password, do not connect to your WiFi and use the ethernet cable instead (using WiFi can cause your Raspberry Pi to have two different IPs, one for WiFi and one for ethernet), choose default browser (I choose firefox), and whether to update software (I skipped that part). Once the operating system installation is done, you will end up on the desktop. Open up the terminal, it has this symbol:
Here we will just follow AdGuard Homes installation guide. So first type in (in one line):
wget 'https://static.adguard.com/adguardhome/release/AdGuardHome_linux_armv6.tar.gz
and hit enter. Then copy and paste in:
tar -f AdGuardHome_linux_armv6.tar.gz -x -v
After that, you enter:
cd ./AdGuardHome/
And lastly:
sudo ./AdGuardHome -s install
So now it should say that the installation was successful.
Once that is done, you can open up the web browser, Firefox in my case, since I chose that in the installation. In the search field, enter “127.0.0.1:3000”, which will take you to the setup part for AdGuard Home:
I let all the interfaces be set to all:
When you set a password, it is important to know that changing the password is not that trivial and takes quite a few steps. Therefore, if this is for yourself, be sure to set a difficult password so you cannot remember it, and be sure to store it in a way that it is not easily accessible. You can check out my guide on how to secure your phone from porn for way to store your passwords.
After that, you are done with the installation and setup of AdGuard Home on your Raspberry Pi.
When the installation of AdGuard Home is done, we now need to configure your home router to use AdGuard Home as your internet filter. Every router is different and has different software, so here, unfortunately, I cannot give you a full step-by-step guide on how to do it. It is also possible that your router software lacks the capabilities to configure your AdGuard Home as a DNS filter. I have personally installed the open-source router software OpenWRT on my router, so I will show you how I configure the router in that software’s GUI called LuCi. You probably have a lot of similarities in your router software and should still be able to follow along with most of the steps.
If you realize that your router software lacks the capabilities needed to set up AdGuard Home, you will have to investigate flashing OpenWRT to your router. But be VERY careful, as doing so will void any warranty, and I will not take responsibility for you doing that. I can unfortunately not give you a guide in doing so either, as the process is different for each router.
To access your router, type in the IP “192.168.1.1” in your web browser. If your router page does not load, it is most likely on a different IP, for example, “192.168.1.0”. Log in to your router. if you have not done this before, the username is likely “Admin” or something like that, and the password could be blank (so just press enter), “Password”, or “Admin”.
The first step will be to set your Raspberry Pi’s IP to a static one. If you do not do this, it is possible that it might change in the future, and this could cause the whole home network to be unable to access the internet. So, let's plug in the Raspberry Pi via an ethernet cable to the home router. In OpenWRT, you should now be seeing your Raspberry Pi on the first page, and they have made it simple so you can just hit “Set Static”, and your Raspberry Pi now has a static IP. I would recommend doing this on your other devices as this will be very useful when doing filtering in AdGuard Home, which we will get to later in this guide.
The next step is to forward all your internet traffic through the Raspberry Pi so AdGuard Home can filter it. In OpenWRT, go to Network → Firewall → Port Forwards and then add a new forward for port 53 with the following configuration (Internal IP address is the IP address of your Raspberry Pi):
We also need to add a NAT rule, so go to Network → Firewall → NAT Rules and add a rule with these settings:
Once that is done, we have to make some changes to the DHCP server. Let’s go to Network → Interfaces → lan (Edit button) → DHCP Server → Advanced settings → DHCP-Options and then typing in the following and hit the “+” sign:
6, 192.168.1.x
Where x is what you set as the Raspberry Pi’s host ID in the static IP, in my case 201.
Doing the steps of router configuration above should have made it so AdGuard Home is now the filter of internet traffic. One slight problem when using OpenWRT (this might not be the case for other router software) is that if you simply unplug the ethernet cable between your router and Raspberry Pi, you gain full access to the internet, and AdGuard Home filter is rendered useless. To stop this, go to Network → DHCP and DNS → Resolv and Host files and check the “Ignore resolv file” box. This should make it so that your Raspberry Pi MUST be plugged in for you to gain access to the internet. If you are running a dual Raspberry Pi setup, you would still have internet access if one of them shuts down.
Now, when we have finally done all the installations on the Raspberry Pi and the configurations on the home router, we can move on to some actual DNS filtering. On any computer connected to your router network, you can access the AdGuard Home dashboard at its IP (in my case, it is 192.168.1.201). In AdGuard Home, there are two powerful ways of filtering: public DNS servers and a custom blocking list.
A simple, quick, and broad way to filter your home network’s internet traffic is to use public DNS servers that have blocked certain websites. Some recommendations to investigate:
In AdGuard Home, you configure what DNS servers are to be used under Settings -> DNS Settings, and then type in the DNS servers that are to be used in the “Upstream DNS servers” text field and scroll down and hit “Apply”. For example, using Cleanbrowsing’s DNS-servers it would look like this:
A more powerful, although also more time-consuming way to filter the internet traffic is to create your own custom filter list. You can do this under Filters -> Custom filtering rules. If I, for example, want to block youtube.com, I would enter youtube.com into a new line in the text field. That is the most basic way to do it, but AdGuard Home comes with a lot of powerful syntax.
Let us look at the following examples:
||youtube.com
*net*
The “||” in “||youtube.com” says that youtube.com itself is blocked, but also all other subdomains that contain “youtube.com”. For instance, “accounts.youtube.com” would also be banned. The “*” in “net” matches all characters, so all domains containing the word “net” would be blocked. This means that netflix.com is blocked, but also example.net.
If you want to achieve very strict filtering in AdGuard Home, this is the way to do it:
This will block the whole internet since “||*” matches all domains.
The “@@” tells AdGuard Home that the rule you have set is for whitelisting. Therefore, if you enter “@@||youtube.com” domains and subdomains containing “youtube.com” will be unlocked. “@@*example” will unblock all domains containing the word “example”. If you choose to go with this approach, you have to check the “Query Log” tab for what DNS requests are being made. Most websites use CDNs that have unique domains themselves. For example, “@@||youtube.com” would not be enough for you to be able to watch YouTube videos; you would have to unblock several other domains as well. Here is a picture of some of the DNS requests that are being made when you enter youtube.com:
The Query Log tab is also for great tracking all the browsing your kids are doing.
There are several ways to disable/bypass AdGuard Home, so I have made a guide for blocking circumventions and bypasses around AdGuard in which you buy here here. I have it paywalled to cover the cost of this website and so people searching for workarounds cannot access them easily. Hope it helps!