The AdGuard Home dashboard

Blocking Ads with AdGuard Home on a Raspberry Pi in 10 Minutes

Ivan Ha
5 min readAug 14, 2020

--

AdGuard Home is an open-sourced network-wide ads blocking software, once it’s working, it can block ads to all your devices without additional set up.

AdGuard Home is basically a DNS server and utilizes a technique called DNS sinkholing. In short, it means it will drop the DNS request when it’s a listed ads domain. And because we’re going to use it as the DNS server of the home network, that’s why it can do network-wide ads blocking.

It can be installed in various OS, you can install it on a NAS, computer, etc. And I’m using a Raspberry Pi.

Without further ado, let’s the installation then I’ll also go through some FAQs.

1. Install AdGuard Home

Go to your Raspberry Pi, open a terminal, type the following

wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_arm.tar.gztar xvf AdGuardHome_linux_arm.tar.gzcd AdGuardHomesudo ./AdGuardHome -s install

After that, you should see the install success message.

Install success message

2. Set up AdGuard Home using the dashboard

Back to your computer, open a browser and go to http://{your-raspberry-pi-ip}:3000. Then, you should see the greeting screen.

Set up step 1/5

In step 2, we’re going to set the dashboard and DNS server port. The default dashboard port is 80 but here I used port 3000 because my port 80 was used by another service already.

Set up step 2/5

In step 3, we’ll set the dashboard login account.

Set up step 3/5

In step 4, it teaches you how to configure AdGuard Home as the DNS server, we’ll go through it in our next steps, you can just press Next to skip it.

Set up step 4/5

We’re all set, time to set up the router.

Set up step 4/5

3. Set up AdGuard Home as DNS server in the router

Open the admin page of your router, look for the DNS setting section. Then put {your-raspberry-pi-ip} as the DNS address.

Chances are your router can assign more than one DNS, but please don’t. Otherwise, the ads related DNS requests will be resolved in the secondary or third DNS, then the ads won’t be blocked. AdGuard Home should be the sole DNS server in order to work properly.

Router DNS setting

p.s. if your router doesn’t have a DNS setting (which is unlikely), you can configure AdGuard Home as the DHCP server instead. The principle is to make sure the Internet traffic should go through AdGuard Home first.

Up to this step, AdGuard Home should be basically configured and running. And to summarize here is the network setup.

Network with AdGuard Home in place

4. Verify AdGuard Home is configured properly

To verify AdGuard Home is configured properly, you can use tools like host or nslookup.

For example, in your computer, type host doubleclick.net, you should see the host not found message, because the default DNS server is now AdGuard Home, which drops the request. Meanwhile, by explicitly setting 8.8.8.8 as the DNS server, you can see the DNS resolves successfully.

If you failed the verification, you should check

  1. the router DNS setup, make sure {your-raspberry-pi-ip} is the sole DNS, and a reboot may be needed for some router model
  2. the computer setup, make sure to use your router as the sole DNS, don’t set a secondary DNS
Verify AdGuard Home is configured properly

That’s it for the installation, hope you enjoy it, and the default setting of AdGuard Home should be enough for normal use. If you need extra configuration, just visit the dashboard. I won’t go into much detail, the dashboard is pretty strict forward, if you can follow the above, you should’ve no problem.

FAQs

1. What are the advantages of AdGuard Home compare to the traditional browser adblocking plugin?

Because AdGuard Home is network-wide, so it can block ads to all devices connected to that router, including those never able to install a ad-block plugin, e.g. smart TV, IoT devices.

Also, the setup is easier since you don’t need to install a plugin for each device.

However, applying DNS sinkholing can’t block 100% of the ads due to its nature, for detail please read the official GitHub.

2. AdGuard Home is the sole DNS now, what if it’s down?

You won’t be able to reach the Internet (to be precise you can reach by direct hitting the server IP address, if you can remember it 😃). But the fix is also easy, just by replacing your router DNS setting to another DNS address, e.g. 8.8.8.8 or 1.1.1.1 , etc. everything will be back.

3. After using AdGuard Home, some Web site is down / style is broken / not function properly, what should I do?

There is a log section in the dashboard, check if any unexpected requests being blocked, and unblock them until back to normal.

AdGuard Home query log

4. Will AdGuard Home make the Internet speed slower?

Maybe, but not noticeable. As shown in the dashboard, the average processing time is ms level. After experiencing for a week or so, I don’t feel any difference.

p.s. I’m using a Raspberry Pi 3 Model B to host the AdGuard Home, and I don’t even use an Ethernet cable, just leave it connected to the Wi-Fi.

The average process time is ms level

5. Any extra feature more than just ads blocking?

Yes.

  • parental control (global and per client)
  • security site screening
  • domain blacklisting

--

--