How can i correctly setup a local DNS server with BIND?

How can i correctly setup a local DNS server with BIND?

i setup a DNS server via Docker on my OMV NAS.

NAS has static IP: 192.168.0.10 (DNS is reachable via Webmin)

NAS runs BIND-Dns with Webmin in Docker listening on IP: 192.168.0.10:53

In my router i configured IP: 192.168.0.10 as 1st DNS Server (cloudflare as second)

When i do:

host@host ~ % nslookup nas.tst.lan 192.168.0.1
Server:     192.168.0.1
Address:    192.168.0.1#53

Name:   nas.tst.lan
Address: 192.168.0.10

When i do:

host@host ~ % sudo killall -HUP mDNSResponder     

an then do:

host@host ~ % nslookup nas.tst.lan 192.168.0.1
Server:     192.168.0.1
Address:    192.168.0.1#53

** server can't find nas.tst.lan: NXDOMAIN

I assume that is bc of TTL of the old config, but i didn´t change anything. At least not wanted.

When i dig

host@host ~ % dig @192.168.0.10 nas.tst.lan 

; <<>> DiG 9.10.6 <<>> @192.168.0.10 nas.tst.lan
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 20926
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;nas.tst.lan.       IN  A

;; Query time: 42 msec
;; SERVER: 192.168.0.10#53(192.168.0.10)
;; WHEN: Sun Dec 27 11:31:05 CET 2020
;; MSG SIZE  rcvd: 47

but when i dig

host@host ~ % dig @192.168.0.1 nas.tst.lan  

; <<>> DiG 9.10.6 <<>> @192.168.0.1 nas.tst.lan
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 6591
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;nas.tst.lan.       IN  A

;; AUTHORITY SECTION:
.           86159   IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2020122700 1800 900 604800 86400

;; Query time: 46 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Sun Dec 27 11:30:41 CET 2020
;; MSG SIZE  rcvd: 122

So what did i do wrong?

答案1

Thing can be closed.

The problem was:

There is a difference between WAN-DNS and LAN-DNS in my Router.

I had the WAN-DNS configured as my local DNS. So that was the failure, i could´t understand.

Now the WAN-DNS is back to generic and the LAN-DNS is now configured with 192.168.0.10 and 1.1.1.1 as secondary.

If dig runs to the Router it uses the generic DNS of my ISP.

If dig runs directly to the local DNS it resolves correctly.

One thought:

Tha LAN-DNS - Function is called conditional forwarding.

This is possible on my, but may not be possible on any router. So for them i don´t have an answer.

相关内容