Post

Husband Is Playing Mobile Games While I Watch Dns Queries From His Phone To Block The Ads For Him

Title: Husband Is Playing Mobile Games While I Watch DNS Queries From His Phone To Block The Ads For Him.

Title: “Husband Is Playing Mobile Games While I Watch DNS Queries From His Phone To Block The Ads For Him”

Introduction

In this guide, we will delve into a practical solution to monitor and block ads at the DNS level for your home network. As a DevOps engineer with 15+ years of experience, you understand the importance of system administration in maintaining a smooth and ad-free environment within your homelab or self-hosted setup. By the end of this post, you will have learned how to set up a powerful DNS filter on your network that can help reduce ad traffic significantly, improving the overall performance of your network and providing a cleaner browsing experience for your household.

Prerequisites

  • Operating System: Linux (Ubuntu Server 20.04 LTS or CentOS 8 Stream) with root access
  • Hardware: Minimum 2GB RAM, 1 vCPU, 20GB SSD storage
  • Network Requirements: Stable internet connection, internal network setup (e.g., LAN)
  • Software: PowerDNS Authoritative Server (version 4.x), Dnsmasq (version 2.83 or higher), AdGuard Home (version 1.7.5 or higher)
  • Firewall Considerations: Ensure that ports 53 (UDP/TCP), 67 (UDP), and 68 (UDP) are open for DHCP, as well as port 9053 (UDP) for PowerDNS Authoritative Server.
  • User Permissions: Root access is required for installation and configuration.

Installation & Setup

Step 1: Install PowerDNS Authoritative Server

1
2
   sudo apt-get update
   sudo apt-get install powerdns-authoritative

Step 2: Configure PowerDNS Authoritative Server (/etc/powerdns/pdns.conf)

  • Set zone configuration for your domain(s):
    1
    2
    3
    4
    
    zone mydomain.local {
      type master;
      filemaster /etc/powerdns/db.mydomain.local;
    }
    

Step 3: Install Dnsmasq

1
   sudo apt-get install dnsmasq

Step 4: Configure Dnsmasq (/etc/dnsmasq.conf)

  • Set up the DHCP and DNS server configuration:
    1
    2
    3
    
    dhcp-range=set:home,192.168.1.50,static,192.168.1.200,255.255.255.0,12h
    dns-forward-max=1000
    server=/adguard.io@192.168.1.1
    

Step 5: Install AdGuard Home

  • Download and unpack the latest version of AdGuard Home from https://github.com/AdguardTeam/AdGuardHome
  • Run the installation script as root (you may need to modify it for your Linux distribution):
    1
    
    sudo ./install.sh
    

Configuration

Usage & Operations

Troubleshooting

Conclusion

By following this guide, you will have successfully set up a powerful DNS filter for your home network, significantly reducing ad traffic and improving the overall browsing experience. In future posts, we’ll explore advanced topics such as integrating AdGuard Home with other services and performance tuning for large-scale environments.

For more information about PowerDNS Authoritative Server, Dnsmasq, and AdGuard Home, please refer to their official documentation:

This post is licensed under CC BY 4.0 by the author.