13

I need to check the differences in records on master and slave when making changes. Is there some option for dig to show which Authoritative Name Server provided the answer?

for example

dig example.com +short +identify
93.184.216.34 from server 192.168.1.1 in 1 ms.

Shows my IP as the source of information not one of the NS records.

How can I found out, where did it get that information?

EDIT: Output of the Alfred's suggestion

# dig foo.example.com +all

; <<>> DiG 9.9.3-rl.156.01-P1-RedHat-9.9.3-3.P1.fc17 <<>> foo.example.com +all
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 1612
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;foo.example.com.       IN  A

;; AUTHORITY SECTION:
example.com.        2924    IN  SOA sns.dns.icann.org. noc.dns.icann.org. 2015082460 7200 3600 1209600 3600

;; Query time: 1 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: St dec 02 14:36:24 CET 2015
;; MSG SIZE  rcvd: 101

#

Server 192.168.1.1 is localhost (my cashing name server) ;; SERVER: 192.168.1.1#53(192.168.1.1) I need to find out which Authoritative Name Server provided the answer.

No output for subdomain +nssearch

# dig foo.example.com +nssearch
# dig www.google.com +nssearch
# dig en.wikipedia.org +nssearch
# dig www.fsf.org +nssearch
#

But when asking for the domain which has it's own zone file, +nssearch gives an answer

# dig example.com +nssearch
SOA sns.dns.icann.org. noc.dns.icann.org. 2018050821 7200 3600 1209600 3600 from server 199.43.135.53 in 108 ms.
SOA sns.dns.icann.org. noc.dns.icann.org. 2018050821 7200 3600 1209600 3600 from server 199.43.133.53 in 160 ms.
;; no response from 2001:500:8d::53
# dig google.com +nssearch
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.32.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.36.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.38.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 203084235 900 900 1800 60 from server 216.239.34.10 in 37 ms.
;; no response from 2001:4860:4802:34::a
;; no response from 2001:4860:4802:32::a
;; no response from 2001:4860:4802:36::a
# dig wikipedia.com +nssearch
SOA ns0.wikimedia.org. hostmaster.wikimedia.org. 2018031919 43200 7200 1209600 3600 from server 91.198.174.239 in 23 ms.
SOA ns0.wikimedia.org. hostmaster.wikimedia.org. 2018031919 43200 7200 1209600 3600 from server 208.80.154.238 in 139 ms.
SOA ns0.wikimedia.org. hostmaster.wikimedia.org. 2018031919 43200 7200 1209600 3600 from server 208.80.153.231 in 151 ms.
# dig fsf.org +nssearch
SOA ns1.gnu.org. hostmaster.gnu.org. 2941143849 3600 300 3600000 3600 from server 46.43.37.70 in 35 ms.
SOA ns1.gnu.org. hostmaster.gnu.org. 2941143849 3600 300 3600000 3600 from server 208.118.235.164 in 110 ms.
;; no response from 2001:41c8:20:2d3::a
#

Thank you again Alfred.

8
  • The command shows the server IP. What is the question?
    – 030
    Dec 2, 2015 at 13:18
  • The server (192.168.1.1) does not have a zone file for the domain. I need to find out which authority server provided the answer.
    – Aas
    Dec 2, 2015 at 13:33
  • Could you issue the command provided in the answer and add the outcome to the question? If you issue this command it should return the server.
    – 030
    Dec 2, 2015 at 13:35
  • And what returns dig foo.example.com +nssearch?
    – 030
    Dec 2, 2015 at 13:44
  • I assume you have replaced foo.example.com with the real address you would like to check? foo.example.com should return nothing indeed.
    – 030
    Dec 2, 2015 at 13:50

3 Answers 3

14

From the man page:

DESCRIPTION dig (domain information groper) is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried. Most DNS administrators use dig to troubleshoot DNS problems...

dig foo.example.com +all

Issuing this command returns the server:

;; Query time: 32 msec
;; SERVER: IP#XY(IP)
;; WHEN: Wed Dec 02 14:34:50 CET 2015
;; MSG SIZE  rcvd: 39
  +[no]nssearch
       When this option is set, dig attempts to find the
       authoritative name servers for the zone containing the name
       being looked up and display the SOA record that each name
       server has for the zone.
dig foo.example.com +nssearch

Also check:

  1. Using dig to query nameservers
  2. How do I find the authoritative name-server for a domain name?
2
  1. Check it in the 192.168.1.1 (the caching nameserver) logs.
  2. Or better, simply don't use a caching nameserver:

    dig example.com. @ns-master.example.com. +short +identify

    dig example.com. @ns-slave1.example.com. +short +identify

1

Using DiG 9.18.10 I got no output when using +nssearch. I don't know why.

+trace worked, however.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .