Unbound – eigener rekursiver DNS-Server 2025

Kein externer DNS-Anbieter nötig – direkt Root-Server befragen

S
SeeColors IT
11. Juni 20264 Min. Lesezeit229 Aufrufe

Warum eigener rekursiver DNS?

Standard:   Client → Cloudflare/Google → Root → TLD → Domain
Problem:    Cloudflare/Google sehen ALLE eure DNS-Anfragen!

Mit Unbound:
Client → Unbound → Root → TLD → Domain (direkt!)
Kein Drittanbieter sieht eure Anfragen!

Unbound installieren

apt install -y unbound unbound-anchor

# Root-Key für DNSSEC
unbound-anchor -a /var/lib/unbound/root.key

# Root-Hints (Liste der Root-Nameserver)
curl -o /var/lib/unbound/root.hints     https://www.internic.net/domain/named.cache

systemctl enable --now unbound
unbound-control status

Unbound Konfiguration

cat > /etc/unbound/unbound.conf << 'EOF'
server:
    verbosity: 1
    interface: 0.0.0.0
    port: 53
    do-ip4: yes
    do-ip6: no
    do-udp: yes
    do-tcp: yes

    # Zugriff erlauben
    access-control: 0.0.0.0/0 refuse
    access-control: 127.0.0.0/8 allow
    access-control: 192.168.0.0/16 allow
    access-control: 10.0.0.0/8 allow

    # Root Hints
    root-hints: "/var/lib/unbound/root.hints"

    # DNSSEC
    auto-trust-anchor-file: "/var/lib/unbound/root.key"
    val-log-level: 1

    # Performance
    num-threads: 4
    msg-cache-size: 128m
    rrset-cache-size: 256m
    cache-min-ttl: 0
    cache-max-ttl: 86400
    prefetch: yes
    prefetch-key: yes
    qname-minimisation: yes    # Privatsphäre: minimal DNS leaken

    # Härtung
    harden-glue: yes
    harden-dnssec-stripped: yes
    harden-below-nxdomain: yes
    use-caps-for-id: no

    # Interne Domains nicht nach außen
    private-address: 192.168.0.0/16
    private-address: 10.0.0.0/8
    private-domain: "firma.local"

# Lokale Zone für interne Hosts
local-zone: "firma.local." static
local-data: "nas.firma.local. IN A 192.168.1.100"
local-data: "proxmox.firma.local. IN A 192.168.1.101"
EOF

unbound-checkconf
systemctl restart unbound

# Test
dig @127.0.0.1 google.de
dig @127.0.0.1 firma.local

Unbound mit Pi-hole kombinieren

# Pi-hole (Port 53) → Unbound (Port 5335)

# Unbound auf Port 5335
sed -i 's/port: 53/port: 5335/' /etc/unbound/unbound.conf
sed -i 's/interface: 0.0.0.0/interface: 127.0.0.1/' /etc/unbound/unbound.conf
systemctl restart unbound

# Pi-hole: Custom DNS auf Unbound
# Admin → Settings → DNS
# Custom 1: 127.0.0.1#5335

# Jetzt: Pi-hole blockt Werbung, Unbound befragt direkt Root-Server!

DNSSEC-Validation testen

# DNSSEC-gesicherte Domain
dig sigok.verteiltesysteme.net @127.0.0.1
# → ad-Flag (Authenticated Data) muss gesetzt sein!

# DNSSEC-ungültige Domain (muss fehlschlagen)
dig sigfail.verteiltesysteme.net @127.0.0.1
# → SERVFAIL (korrekt - ungültige Signatur)

FAQ

Ist Unbound langsamer als Cloudflare-DNS?
Erste Anfrage langsamer (muss rekursiv auflösen). Aber: Caching macht Folge-Anfragen oft schneller als externe DNS. QNAME-Minimisation für Privatsphäre leicht langsamer.

Fazit

Unbound + Pi-hole ist die perfekte lokale DNS-Kombination: Werbeblocker + kein Drittanbieter-DNS + DNSSEC-Validierung.

DNS und Datenschutz für KMU in Heidelberg, Mannheim und der Rhein-Neckar-Region. Anfragen.

Artikel teilen

War dieser Artikel hilfreich?

Dein Feedback hilft uns, bessere Inhalte zu erstellen.

Kommentar hinterlassen

Verwandte Artikel