Comprehensive Guide to Setting Up a VPS as a Global Filtering Proxy for Family Internet Optimization and Security
A detailed guide on setting up a VPS as a global filtering proxy for family use, optimizing connectivity and enhancing internet security with tools like Pi-hole, DNS over HTTPS, and...
Image credit: TerriC · Pixabay Content License
Introduction
In today's digital age, protecting your family from harmful content and optimizing internet connectivity is essential. A highly effective solution is to set up a Virtual Private Server (VPS) as a global filtering proxy for your entire home network. With the DPTCloud platform, you can deploy a robust, stable, and easy-to-manage security system.
Requirements and Preparation
Before you begin, ensure you have:
- A VPS from DPTCloud (minimum 1GB RAM, 1 vCPU)
- SSH access to the VPS (usually root or a user with sudo privileges)
- The public IP address of the VPS (or a domain name if available)
- Your home network configured to use the VPS's DNS or proxy
Setting Up the Global Filtering Proxy
We will use Pi-hole for content filtering, DNS over HTTPS (DoH) for enhanced DNS security, and iptables or UFW for firewall configuration.
1. Install Pi-hole
Run the following command on your VPS to install Pi-hole:
curl -sSL https://install.pi-hole.net | bash
During installation, select DNS settings and enable options like "Block ads" and "Block tracking domains."
2. Configure DNS over HTTPS
To enhance security, use DNS over HTTPS instead of standard DNS. Run these commands:
sudo apt update
sudo apt install -y dns-over-https
Then configure DNS in the /etc/dns-over-https.conf file:
server=1.1.1.1
server=8.8.8.8
Restart the service:
sudo systemctl restart dns-over-https
3. Configure the Firewall
Use UFW to manage the firewall. Install and enable UFW:
sudo apt install -y ufw
sudo ufw allow ssh
sudo ufw allow 53/tcp
sudo ufw allow 53/udp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
Configure Your Home Network
On your home router, set the DNS to use the VPS's IP address. For example:
- DNS primary:
192.168.1.100(VPS IP) - DNS secondary:
1.1.1.1(if needed)
Alternatively, if your router supports it, set up a transparent proxy so all traffic passes through the VPS.
Testing and Verification
To verify the filtering system is working, perform the following steps:
- Open a browser and visit an ad-heavy site (like
google.com) – it should be blocked if Pi-hole is active. - Run the command:
pihole -cto check Pi-hole status. - Try accessing a blocked site to confirm it is blocked.
Troubleshooting
- No internet access: Check UFW rules to ensure necessary ports (80, 443, 53) are open.
- Pi-hole not blocking ads: Review Pi-hole's block lists and update them if needed.
- DNS not working: Verify network connectivity and DNS configuration on the router.
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
