How to find what Authoritative Name Server provided the answer using dig?

Solution 1:

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?

Solution 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