DNS DoS attack? Stop it now. Check, patch, or mitigate dnsdist CVEs with actual commands for Ubuntu, Rocky, SUSE. Includes automation script + free lab.
You don’t run a DNS resolver because it’s fun. You run it because your apps, users, and infrastructure depend on it. When a use-after-free or a crafted QUIC packet can take your entire load balancer offline, you have a problem.
In April 2026, the dnsdist team patched seven CVEs (CVE-2026-0396 through CVE-6-27854). But here is the truth: this won’t be the last time. This guide is your reusable playbook to check, fix, and survive DNS DoS vulnerabilities on any major Linux distro—today and next year.
How to check if you are vulnerable (actual commands)
# Check installed version dpkg -l | grep dnsdist # If version < 1.9.12, you are vulnerable # Check for running service systemctl status dnsdist
# Check installed version rpm -qa | grep dnsdist # Query specific package info rpm -qi dnsdist | grep Version
# Check version zypper info dnsdist # Or use rpm rpm -qa | grep dnsdist
Automation script to apply the fix (bash for major distros)
#!/bin/bash # dnsdist DoS vulnerability fix script (CVE-2026 family) # Works on Ubuntu 22.04+, Rocky 9+, SUSE 15+ set -e # Detect OS if [ -f /etc/os-release ]; then . /etc/os-release OS=$ID VER=$VERSION_ID else echo "Cannot detect OS. Exiting." exit 1 fi echo "Detected: $OS $VER" case $OS in ubuntu|debian) apt-get update apt-get install --only-upgrade dnsdist -y ;; rocky|almalinux|rhel|centos) dnf update dnsdist -y ;; suse|opensuse-leap|opensuse-tumbleweed) zypper refresh zypper update -y dnsdist ;; *) echo "Unsupported OS. Update dnsdist manually from https://dnsdist.org" exit 1 ;; esac # Restart service systemctl restart dnsdist systemctl status dnsdist --no-pager echo "Fix applied. Verify with: dnsdist --version"
Alternative mitigation if you can’t update now
1. iptables rate-limit for new connections
# Limit to 100 new connections per second per source IP iptables -A INPUT -p udp --dport 53 -m state --state NEW -m recent --set iptables -A INPUT -p udp --dport 53 -m state --state NEW -m recent --update --seconds 1 --hitcount 100 -j DROP
2. Block DNS over QUIC/HTTP3 (CVE-2026-24030)
setLocal("0.0.0.0:53") -- standard DNS
-- setLocal("0.0.0.0:443", "udp") -- QUIC – COMMENT OUT
setLocal("0.0.0.0:443", "tcp") -- Keep DoH over TCP only if needed
3. Use a reverse proxy with AppArmor
# Create a minimal profile aa-genprof dnsdist # Then enforce it aa-enforce /usr/sbin/dnsdist
Hands-on Lab: Reproduce & test the fix safely
Step 1: Create docker-compose.yml
version: '3.8' services: vulnerable-dnsdist: image: powerdns/dnsdist-18:1.9.11 # Vulnerable version ports: - "5300:53/udp" - "5300:53/tcp" command: --uid gid --local 0.0.0.0:53 --client 0.0.0.0/0 fixed-dnsdist: image: powerdns/dnsdist-18:1.9.12 # Patched version ports: - "5400:53/udp" - "5400:53/tcp" command: --uid gid --local 0.0.0.0:53 --client 0.0.0.0/0 attacker: image: alpine:latest command: tail -f /dev/null depends_on: - vulnerable-dnsdist - fixed-dnsdist
Step 2: Simulate a DoS attack
docker exec -it lab_attacker_1 sh # Install DNS tools apk add bind-tools drill # Send flood of random queries while true; do drill @vulnerable-dnsdist -p 5300 random$RANDOM.local; done

Nenhum comentário:
Postar um comentário