DNS Redundancy using Keepalived and VRRP
Case Study: Non-Invasive High Availability DNS with AdGuard Home & Keepalived
Ensuring 99.9% Uptime without modifying Core Router configurations.
1. Executive Summary
In any home lab or small office, DNS is a critical service. A single point of failure here means a total network-wide "internet outage." This case study explores a Non-Invasive High Availability (HA) setup using AdGuard Home and Keepalived on Proxmox LXC. The goal: Zero downtime during maintenance while keeping the core router configuration simple and untouched.
2. Key Technical Concepts
- Keepalived: A routing software that monitors services and manages failover automatically.
- VRRP (Virtual Router Redundancy Protocol): The protocol used by servers to "talk" and share a single Virtual IP (VIP).
- Keep Alive: A mechanism to check if a connection or a neighbor node is still active.
- Non-Invasive Design: Failover logic is handled at the Linux level, so the core router doesn't need complex OSPF or BGP scripts.
3. Infrastructure Topology
4. Step-by-Step Implementation (Beginner Friendly)
Step 1: The Foundation (LXC Setup)
Create two Debian-based LXC containers on Proxmox. Ensure your network subnet is /24 (255.255.255.0). This ensures the servers can "see" the Virtual IP.
Step 2: Install Redundancy Tools
On both containers, run: apt update && apt install keepalived -y
Step 3: Configure the "Brain" (Keepalived Config)
Edit /etc/keepalived/keepalived.conf. Set Node 1 to Priority 100 and Node 2 to Priority 90. This tells the network that Node 1 is the leader.
Step 4: Clear the Path (Port 53)
Disable the default Linux DNS service to let AdGuard Home take over: systemctl stop systemd-resolved && systemctl disable systemd-resolved
Step 5: AdGuard Home "Bind" Setting
In your AdGuardHome.yaml, set bind_hosts: 0.0.0.0. This is the secret sauce that allows AdGuard to answer requests from both its physical IP and the Virtual IP.
5. Test Cases
| Test Scenario | Action | Expected Result |
|---|---|---|
| Normal Operation | Ping 192.168.50.100 | Consistent replies from Node 1. |
| Hard Failover | Shutdown Node 1 LXC | VIP moves to Node 2 (1-2 packets lost). |
| Self-Healing | Restart Node 1 | Node 1 reclaims the VIP (Preemption). |
6. Why This is "Pro" Level
By keeping the logic inside Linux/Proxmox, you achieve Hardware Independence. Whether you use a MikroTik, Asus, or TP-Link router, the setup remains the same. You don't risk breaking your core network because all the "magic" happens inside the containers.




Comments
Post a Comment