How do I find the authoritative name-server for a domain name?

前端 未结 12 1983
你的背包
你的背包 2021-01-29 17:17

How can I find the origins of conflicting DNS records?

12条回答
  •  心在旅途
    2021-01-29 17:37

    You used the singular in your question but there are typically several authoritative name servers, the RFC 1034 recommends at least two.

    Unless you mean "primary name server" and not "authoritative name server". The secondary name servers are authoritative.

    To find out the name servers of a domain on Unix:

      % dig +short NS stackoverflow.com
     ns52.domaincontrol.com.
     ns51.domaincontrol.com.
    

    To find out the server listed as primary (the notion of "primary" is quite fuzzy these days and typically has no good answer):

    % dig +short  SOA stackoverflow.com | cut -d' ' -f1
    ns51.domaincontrol.com.
    

    To check discrepencies between name servers, my preference goes to the old check_soa tool, described in Liu & Albitz "DNS & BIND" book (O'Reilly editor). The source code is available in http://examples.oreilly.com/dns5/

    % check_soa stackoverflow.com
    ns51.domaincontrol.com has serial number 2008041300
    ns52.domaincontrol.com has serial number 2008041300
    

    Here, the two authoritative name servers have the same serial number. Good.

提交回复
热议问题