Guide to Building a Private DNS Server to Block Ads System-Wide with AdGuard Home on Oracle Free Tier VPS
A detailed guide to deploying AdGuard Home on Oracle Free Tier VPS to create a private DNS server that blocks ads system-wide, protects privacy, and speeds up web access. Includes...
Introduction
Deploying a private DNS server gives you full control over network traffic, blocks ads, prevents tracking, and enhances privacy. With Oracle Free Tier VPS, you can build an effective, free, and easy-to-deploy DNS solution. This guide shows how to deploy AdGuard Home—an open-source tool—on Oracle Free Tier VPS using Docker to create a system-wide ad-blocking DNS server.
Overview of AdGuard Home
AdGuard Home is an open-source DNS server that enables you to:
- Block ads, malware, and tracking across your entire network.
- Configure custom filtering rules.
- Monitor DNS activity and generate reports.
- Function as a local or remote DNS server.
Prerequisites and Setup
- Oracle Free Tier VPS: Ensure you have registered and activated an Oracle Cloud Free Tier account with VPS access.
- SSH Access: Connect to your VPS via SSH (e.g.,
ssh opc@). - Docker: Ensure Docker is installed on your VPS. If not, install it with the following command:
sudo yum install -y docker
sudo systemctl start docker
sudo systemctl enable docker
Deploy AdGuard Home Using Docker
Run AdGuard Home with Docker using the following command:
docker run -d \
--name adguard \
-p 53:53/tcp \
-p 53:53/udp \
-p 853:853/tcp \
-p 3000:3000/tcp \
-v ${HOME}/adguard/config:/opt/adguardhome/conf \
-v ${HOME}/adguard/work:/opt/adguardhome/work \
adguard/adguardhome:latest
Notes:
- Port 53: Used for DNS (TCP/UDP).
- Port 853: Used for DNS over HTTPS (DoH).
- Port 3000: Web admin interface.
- The
configandworkdirectories are mapped to persist configuration and data.
Configure DNS and Test
After startup, access the admin interface at http://.
Follow these steps:
- Select Setup Wizard.
- Go to System → Network → Interface and set your VPS IP address.
- Go to Filtering → Ad Blocking and enable ad-blocking filters (e.g., AdGuard Base, AdGuard DNS Filter).
- Go to Protection → Privacy to enable privacy protection features.
To test, configure your device’s DNS to point to your VPS IP. For example:
nameserver
Optimization and Security
- Running AdGuard Home in Docker simplifies updates and management.
- Secure the admin interface with a strong password.
- Configure the firewall on your VPS to allow only necessary ports (53, 853, 3000).
- Integrate with web caching and performance optimization if needed.
Troubleshooting
- Cannot access port 3000: Verify Docker is running and the firewall isn’t blocking port 3000.
- Ads not blocked: Check that filters are enabled and update the filter lists.
- Device not receiving DNS: Ensure DNS settings on the device are correct and not overridden by another DNS service.
References
Recommended NVMe Cloud VPS Plans to Deploy This Setup
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-3E
10% VAT included
- CPU: 2 vCPU
- RAM: 4 GB
- SSD: 50 GB NVMe
