DNS-Delegation mit BIND und Cloudflare

DNS-Delegation mit BIND und Cloudflare

wahrscheinlich nur eine gewöhnliche Frage, aber ich habe monatelang Stunden damit verschwendet. Wenn Sie andere Protokolle/Ausgaben/Erklärungen usw. benötigen, fragen Sie einfach :)

Dank im Voraus!

Was ich brauche

  • Die Zone local.example.comsoll von einem lokalen Server verwaltet werden10.20.0.9
  • Die lokalen Server (10.20.0.0/24) sind nur innerhalb des Netzwerks erreichbarAber
  • Ihre Hostnamen xxx.local.example.comsind weltweit vom Internet aus auflösbar

Was ich bisher habe

Ich verwende CloudFlare als DNS-Anbieter und folgedieser Leitfadenhabe ich folgendes eingerichtet:

  • Aufzeichnungen bei CloudFlare:
    ns.example.com   A   10.20.0.9       (local DNS server)
    loc.example.com  NS  ns.example.com  (delegation to local DNS)
    
  • Datensätze auf meinem lokalen DNS-Server ( 10.20.0.9mit bind9)
    loc.example.com. IN SOA ns.example.com. hostmaster.example.com. (
        1628517915
        3600
        600
        24H
        3600 )
    s1.loc.example.com.  IN A 10.20.0.9
    

Mein Problem

CloudFlare beantwortet meine NS-Suchanfrage nicht loc.example.comwie ns.example.comerwartet. Stattdessen schlägt die Anfrage einfach mit „Serverfehler“ fehl (siehe letztes CLI-Protokoll) …

CLI-Ausgabe

  • dig ns.example.com

    ; <<>> DiG 9.11.5-P4-5.1+deb10u5-Debian <<>> ns.example.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10036
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 1232
    ;; QUESTION SECTION:
    ;ns.example.com.         IN      A
    
    ;; ANSWER SECTION:
    ns.example.com.  300     IN      A       10.20.0.9
    
    ;; Query time: 111 msec
    ;; SERVER: 1.1.1.1#53(1.1.1.1)
    ;; WHEN: Mon Aug 09 16:42:06 CEST 2021
    ;; MSG SIZE  rcvd: 66
    

    Der Nameserver wird also in unsere lokale IP aufgelöst, super!

  • dig @10.20.0.9 NS loc.example.com

    ; <<>> DiG 9.11.5-P4-5.1+deb10u5-Debian <<>> @10.20.0.9 NS loc.example.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47653
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 7fa7e218d1c20f1e113b236e61113fb96c1b101d374cbde7 (good)
    ;; QUESTION SECTION:
    ;loc.example.com.                IN      NS
    
    ;; ANSWER SECTION:
    loc.example.com. 3600    IN      NS      ns.example.com.
    
    ;; Query time: 1 msec
    ;; SERVER: 10.20.0.9#53(10.20.0.9)
    ;; WHEN: Mon Aug 09 16:46:17 CEST 2021
    ;; MSG SIZE  rcvd: 96
    

    Unser lokaler DNS-Server weiß, dass er für die Subdomäne zuständig ist

  • dig @10.20.0.9 s1.loc.example.com

    ; <<>> DiG 9.11.5-P4-5.1+deb10u5-Debian <<>> @10.20.0.9 s1.loc.example.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38039
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 7790b2d359140e5f04be8596611140927c7321fefc1fbbe9 (good)
    ;; QUESTION SECTION:
    ;s1.loc.example.com. IN      A
    
    ;; ANSWER SECTION:
    s1.loc.example.com. 3600 IN  A       10.20.0.1
    
    ;; AUTHORITY SECTION:
    loc.example.com. 3600    IN      NS      ns.example.com.
    
    ;; Query time: 1 msec
    ;; SERVER: 10.20.0.9#53(10.20.0.9)
    ;; WHEN: Mon Aug 09 16:49:54 CEST 2021
    ;; MSG SIZE  rcvd: 119
    

    Damit der lokale DNS unsere lokalen Hosts auflösen kann

  • dig @1.1.1.1 NS loc.example.com

    ; <<>> DiG 9.11.5-P4-5.1+deb10u5-Debian <<>> @1.1.1.1 NS loc.example.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 33748
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 1232
    ; OPT=15: 00 16 ("..")
    ;; QUESTION SECTION:
    ;loc.example.com.                IN      NS
    
    ;; Query time: 12 msec
    ;; SERVER: 1.1.1.1#53(1.1.1.1)
    ;; WHEN: Mon Aug 09 16:51:45 CEST 2021
    ;; MSG SIZE  rcvd: 57
    

    Hier liegt das Problem:CloudFlare antwortet NICHT auf unsere NS-Datensatzanfrage. Warum :o?

verwandte Informationen