unbound/nsd gibt SERVFAIL zurück und löst den lokalen LAN-DNS auf. nsd allein funktioniert einwandfrei

unbound/nsd gibt SERVFAIL zurück und löst den lokalen LAN-DNS auf. nsd allein funktioniert einwandfrei

Ich habe unbound als lokalen rekursiven DNS-Server verwendet. Habe gerade nsd hinzugefügt, um lokales LAN-DNS einzurichten. nsd lauscht auf Port 53530 und das funktioniert einwandfrei:

$ dig @127.0.0.1 data2.datanet.home -p 53530

; <<>> DiG 9.9.2-P2 <<>> @127.0.0.1 data2.datanet.home -p 53530
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59577
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;data2.datanet.home.            IN      A

;; ANSWER SECTION:
data2.datanet.home.     600     IN      A       192.168.1.62

;; AUTHORITY SECTION:
datanet.home.           600     IN      NS      ns1.datanet.home.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53530(127.0.0.1)
;; WHEN: Mon Jun 15 07:16:24 2015
;; MSG SIZE  rcvd: 81

Beim Durchlaufen des lokalen Unbounds funktioniert es nicht:

$ dig @127.0.0.1 data2.datanet.home

; <<>> DiG 9.9.2-P2 <<>> @127.0.0.1 data2.datanet.home
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 47645
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;data2.datanet.home.            IN      A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jun 15 07:18:02 2015
;; MSG SIZE  rcvd: 47

Hier ist, was ich im ungebundenen Protokoll mit Ausführlichkeit erhalte: 4

Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: validator operate: query router.datanet.home. A IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: validator: pass to next module
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: mesh_run: validator module exit state is module_wait_module
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: iterator[module 1] operate: extstate:module_state_initial event:
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: process_request: new external request event
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: iter_handle processing q with state INIT REQUEST STATE
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: resolving router.datanet.home. A IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: request has dependency depth of 0
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: use stub datanet.home. NS IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: cache delegation returns delegpt
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: DelegationPoint<datanet.home.>: 0 names (0 missing), 1 addrs (0 r
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug:    ip4 127.0.0.1 port 53530 (len 16)
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: iter_handle processing q with state INIT REQUEST STATE (stage 2)
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: resolving (init part 2):  router.datanet.home. A IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: use stub datanet.home. NS IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: iter_handle processing q with state INIT REQUEST STATE (stage 3)
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: resolving (init part 3):  router.datanet.home. A IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: iter_handle processing q with state QUERY TARGETS STATE
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: processQueryTargets: router.datanet.home. A IN
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: processQueryTargets: targetqueries 0, currentqueries 0 sentcount
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] info: DelegationPoint<datanet.home.>: 0 names (0 missing), 1 addrs (0 r
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug:    ip4 127.0.0.1 port 53530 (len 16)
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: attempt to get extra 3 targets
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: skip addr on the donotquery list ip4 127.0.0.1 port 53530 (len 1
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: No more query targets, attempting last resort
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: configured stub servers failed -- returning SERVFAIL
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: store error response in message cache
Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: return error response SERVFAIL

Was soll das hier im Einzelnen? [1947:0] Debug: Adresse in der DonotQuery-Liste überspringen, IP4 127.0.0.1, Port 53530 (Länge 1). Das scheint der Schlüssel zu sein, aber ich bin mir nicht wirklich sicher, warum das da steht.

Hier ist meine gesamte unbound.conf:

server:
  interface: 127.0.0.1
  interface: 192.168.1.50
  use-syslog: yes
  username: "unbound"
  directory: "/etc/unbound"
  trust-anchor-file: trusted-key.key
  access-control: 192.168.1.0/24 allow
  verbosity: 2
  local-zone: "1.168.192.in-addr.arpa" nodefault
remote-control:
  control-enable: yes
  control-interface: 127.0.0.1
  control-port: 8953
  server-key-file: "/etc/unbound/unbound_server.key"
  server-cert-file: "/etc/unbound/unbound_server.pem"
  control-key-file: "/etc/unbound/unbound_control.key"
  control-cert-file: "/etc/unbound/unbound_control.pem"

stub-zone:
  name: "datanet.home"
  stub-addr: 127.0.0.1@53530
#  stub-first: yes
stub-zone:
  name: "1.168.192.in-addr.arpa"
  stub-addr: 127.0.0.1@53530

nsd.conf hat viele Kommentare, also bin ich mir nicht sicher, ob ich es einfügen soll, aber auf jeden Fall scheint nsd gut zu funktionieren. Es ist so ziemlich dasselbe wie die enthaltene Beispiel-Conf, außer dass der Port geändert, die Steuerung aktiviert und die Zonen hinzugefügt werden.

Ich bin diesbezüglich ratlos und freue mich über jede Idee!

Antwort1

Diese Zeile aus dem Protokoll weist auf das Problem hin:

Jun 15 06:12:39 pizza.yoderdev.com unbound[1947]: [1947:0] debug: skip addr on the donotquery list ip4 127.0.0.1 port 53530 (len 1

Unbound lehnt standardmäßig das Senden von DNS-Anfragen an localhost ab. Um die Abfrage von localhost zu ermöglichen, setzen Sie im Abschnitt - der Unbound-Konfiguration das do-not-query-localhostto :noserver

server:
  interface: 127.0.0.1
  interface: 192.168.1.50
  [...]
  do-not-query-localhost: no

Weitere Informationen finden Sie in der Dokumentation zuunbound.conffür eine Beschreibung der Option.

Antwort2

Ich bin auf dasselbe Problem im Split-Horizon-DNS-Kontext gestoßen – das Unbound-Protokoll zeigte an, dass ein„eingehendes bereinigtes Paket“(von NSD erhalten) enthielt den fraglichen IP-Adress-/CNAME-Eintrag, aber nach"Fertigbearbeitung", würde letzteres nicht passiert.

Schließlich löste das Hinzufügen des Äquivalents domain-insecure: "datanet.home"mithilfe von Unbound v1.12.0 und NSD v4.3.3 dieses Problem für mich.

Antwort3

Ich hatte eine ähnliche Fehlermeldung mit einer fast identischen Konfiguration, außer dass ich die folgende Option hatte:

    tls-upstream: yes

Diese Option führte dazu, dass unbound erwartete, dass Upstream-Abfragen für weitergeleitete und Stub-Zonen nur über TLS transportiert würden. Mein autoritativer NSD-Server, auf dem die Stub-Zonen gehostet wurden, war jedoch nur für lokale Verbindungen und ohne TLS konfiguriert. Dies kann auch die SERVFAIL-Antwort verursachen.

Die richtige Konfiguration bestand darin, „auf“ festzulegen tls-upstreamund nostattdessen „ forward-tls-upstreamauf“ yesinnerhalb des forward-zoneAbschnitts festzulegen, wenn die Stub-Zonen nicht auch für den TLS-Transport konfiguriert sind.

verwandte Informationen