<p>How can I find the origins of conflicting DNS records?</p>

[{'answer_id': 38025, 'author': 'Kyle Cronin', 'author_id': 658, 'author_profile': 'https://Stackoverflow.com/users/658', 'pm_score': 1, 'selected': False, 'text': '<p>An easy way is to use an online domain tool. My favorite is <a href="http://whois.domaintools.com/stackoverflow.com" rel="nofollow noreferrer">Domain Tools</a> (formerly whois.sc). I\'m not sure if they can resolve conflicting DNS records though. As an example, the DNS servers for stackoverflow.com are</p>\n\n<pre><code>  NS51.DOMAINCONTROL.COM\n  NS52.DOMAINCONTROL.COM\n</code></pre>\n'}, {'answer_id': 38028, 'author': 'Antti Kissaniemi', 'author_id': 2948, 'author_profile': 'https://Stackoverflow.com/users/2948', 'pm_score': 10, 'selected': True, 'text': '<p>You\'ll want the SOA (Start of Authority) record for a given domain name, and this is how you accomplish it using the universally available <strong>nslookup</strong> command line tool:</p>\n\n<pre><code>command line&gt; nslookup\n&gt; set querytype=soa\n&gt; stackoverflow.com\nServer:         217.30.180.230\nAddress:        217.30.180.230#53\n\nNon-authoritative answer:\nstackoverflow.com\n        origin = ns51.domaincontrol.com # ("primary name server" on Windows)\n        mail addr = dns.jomax.net       # ("responsible mail addr" on Windows)\n        serial = 2008041300\n        refresh = 28800\n        retry = 7200\n        expire = 604800\n        minimum = 86400\nAuthoritative answers can be found from:\nstackoverflow.com       nameserver = ns52.domaincontrol.com.\nstackoverflow.com       nameserver = ns51.domaincontrol.com.\n</code></pre>\n\n<p>The <strong>origin</strong> (or <strong>primary name server</strong> on Windows) line tells you that <strong>ns51.domaincontrol</strong> is the main name server for <strong>stackoverflow.com</strong>.</p>\n\n<p>At the end of output all authoritative servers, including backup servers for the given domain, are listed.</p>\n'}, {'answer_id': 38029, 'author': 'David Precious', 'author_id': 4040, 'author_profile': 'https://Stackoverflow.com/users/4040', 'pm_score': 4, 'selected': False, 'text': '<p>You could find out the nameservers for a domain with the &quot;host&quot; command:</p>\n<pre><code>[davidp@supernova:~]$ host -t ns stackoverflow.com\nstackoverflow.com name server ns51.domaincontrol.com.\nstackoverflow.com name server ns52.domaincontrol.com.\n</code></pre>\n'}, {'answer_id': 38031, 'author': 'Chris de Vries', 'author_id': 3836, 'author_profile': 'https://Stackoverflow.com/users/3836', 'pm_score': 2, 'selected': False, 'text': '<p>You can use the whois service. On a UNIX like operating system you would execute the following command. Alternatively you can do it on the web at <a href="http://www.internic.net/whois.html" rel="nofollow noreferrer">http://www.internic.net/whois.html</a>.</p>\n\n<p>whois stackoverflow.com</p>\n\n<p>You would get the following response.</p>\n\n<p>...text removed here...</p>\n\n<p>Domain servers in listed order:\nNS51.DOMAINCONTROL.COM\nNS52.DOMAINCONTROL.COM</p>\n\n<p>You can use nslookup or dig to find out more information about records for a given domain. This might help you resolve the conflicts you have described.</p>\n'}, {'answer_id': 38034, 'author': 'aryeh', 'author_id': 3288, 'author_profile': 'https://Stackoverflow.com/users/3288', 'pm_score': 5, 'selected': False, 'text': '<p>On *nix:</p>\n\n<pre><code>$ dig -t ns &lt;domain name&gt;\n</code></pre>\n'}, {'answer_id': 38038, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': '<p>The term you should be googling is "authoritative," not "definitive".</p>\n\n<p>On Linux or Mac you can use the commands <code>whois</code>, <code>dig</code>, <code>host</code>, <code>nslookup</code> or several others. <code>nslookup</code> might also work on Windows.</p>\n\n<p>An example:</p>\n\n<pre><code>$ whois stackoverflow.com\n[...]\n   Domain servers in listed order:\n      NS51.DOMAINCONTROL.COM\n      NS52.DOMAINCONTROL.COM\n</code></pre>\n\n<p>As for the extra credit: Yes, it is possible.</p>\n\n<hr>\n\n<p>aryeh is definitely wrong, as his suggestion usually will only give you the IP address for the hostname. If you use <code>dig</code>, you have to look for NS records, like so:</p>\n\n<pre><code>dig ns stackoverflow.com\n</code></pre>\n\n<p>Keep in mind that this may ask your local DNS server and thus may give wrong or out-of-date answers that it has in its cache.</p>\n'}, {'answer_id': 390986, 'author': 'bortzmeyer', 'author_id': 15625, 'author_profile': 'https://Stackoverflow.com/users/15625', 'pm_score': 8, 'selected': False, 'text': '<p>You used the singular in your question but there are typically several authoritative name servers, the RFC 1034 recommends at least two.</p>\n\n<p>Unless you mean "primary name server" and not "authoritative name server". The secondary name servers <strong>are</strong> authoritative.</p>\n\n<p>To find out the name servers of a domain on  Unix:</p>\n\n<pre><code>  % dig +short NS stackoverflow.com\n ns52.domaincontrol.com.\n ns51.domaincontrol.com.\n</code></pre>\n\n<p>To find out the server listed as primary (the notion of "primary" is quite fuzzy these days and typically has no good answer):</p>\n\n<pre><code>% dig +short  SOA stackoverflow.com | cut -d\' \' -f1\nns51.domaincontrol.com.\n</code></pre>\n\n<p>To check discrepencies between name servers, my preference goes to the old <code>check_soa</code> tool, described in Liu &amp; Albitz "DNS &amp; BIND" book (O\'Reilly editor). The source code is available in <a href="http://examples.oreilly.com/dns5/" rel="noreferrer">http://examples.oreilly.com/dns5/</a></p>\n\n<pre><code>% check_soa stackoverflow.com\nns51.domaincontrol.com has serial number 2008041300\nns52.domaincontrol.com has serial number 2008041300\n</code></pre>\n\n<p>Here, the two authoritative name servers have the same serial number. Good.</p>\n'}, {'answer_id': 538472, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Unfortunately, most of these tools only return the NS record as provided by the actual name server itself. To be more accurate in determining which name servers are actually responsible for a domain, you\'d have to either use "whois" and check the domains listed there OR use "dig [domain] NS @[root name server]" and run that recursively until you get the name server listings...</p>\n\n<p>I wish there were a simple command line that you could run to get THAT result dependably and in a consistent format, not just the result that is given from the name server itself. The purpose of this for me is to be able to query about 330 domain names that I manage so I can determine exactly which name server each domain is pointing to (as per their registrar settings).</p>\n\n<p>Anyone know of a command using "dig" or "host" or something else on *nix?</p>\n'}, {'answer_id': 20847800, 'author': 'Nitin Agarwal', 'author_id': 412005, 'author_profile': 'https://Stackoverflow.com/users/412005', 'pm_score': 3, 'selected': False, 'text': '<p>We\'ve built a <a href="https://www.misk.com/tools/" rel="noreferrer">dns lookup tool</a> that gives you the domain\'s <strong>authoritative nameservers</strong> and its common dns records in one request.</p>\n\n<p>Example: <a href="https://www.misk.com/tools/#dns/stackoverflow.com" rel="noreferrer">https://www.misk.com/tools/#dns/stackoverflow.com</a></p>\n\n<p>Our tool finds the authoritative nameservers by performing a realtime (uncached) dns lookup at the root nameservers and then following the nameserver referrals until we reach the authoritative nameservers. This is the same logic that dns resolvers use to obtain authoritative answers. A random authoritative nameserver is selected (and identified) on each query allowing you to find conflicting dns records by performing multiple requests.</p>\n\n<p>You can also view the nameserver delegation path by clicking on "Authoritative Nameservers" at the bottom of the dns lookup results from the example above.</p>\n\n<p>Example: <a href="https://www.misk.com/tools/#dns/stackoverflow.com@f.root-servers.net" rel="noreferrer">https://www.misk.com/tools/#dns/stackoverflow.com@f.root-servers.net</a></p>\n'}, {'answer_id': 39960663, 'author': 'Alex', 'author_id': 1328737, 'author_profile': 'https://Stackoverflow.com/users/1328737', 'pm_score': 4, 'selected': False, 'text': '<p>I found that the best way it to add always the +trace option:</p>\n\n<pre><code>dig SOA +trace stackoverflow.com\n</code></pre>\n\n<p>It works also with recursive CNAME hosted in different provider. +trace trace imply +norecurse so the result is just for the domain you specify.</p>\n'}, {'answer_id': 48893937, 'author': 'Dennis', 'author_id': 8178135, 'author_profile': 'https://Stackoverflow.com/users/8178135', 'pm_score': 1, 'selected': False, 'text': "<p>SOA records are present on all servers further up the hierarchy, over which the domain owner has NO control, and they all in effect point to the one authoritative name server under control of the domain owner. </p>\n\n<p>The SOA record on the authoritative server itself is, on the other hand, not strictly needed for resolving that domain, and can contain bogus info (or hidden primary, or otherwise restricted servers) and should not be relied on to determine the authoritative name server for a given domain.</p>\n\n<p>You need to query the server that is authoritative for the <em>top level domain</em> to obtain reliable SOA information for a given child domain.</p>\n\n<p>(The information about which server is authoritative for which TLD can be queried from the root name servers).</p>\n\n<p>When you have reliable information about the SOA from the TLD authoritative server, you can then query the primary name server itself authoritative (the one thats in the SOA record on the gTLD nameserver!) for any other NS records, and then proceed with checking all those name servers you've got from querying the NS records, to see if there is any inconsistency for any other particular record, on any of those servers.</p>\n\n<p>This all works much better/reliable with linux and dig than with nslookup/windows.</p>\n"}, {'answer_id': 61221144, 'author': 'dannyw', 'author_id': 3518106, 'author_profile': 'https://Stackoverflow.com/users/3518106', 'pm_score': 2, 'selected': False, 'text': '<p>I have found that for some domains, the above answers do not work.  The quickest way I have found is to first check for an NS record.  If that doesn\'t exist, check for an SOA record.  If that doesn\'t exist, recursively resolve the name using dig and take the last NS record returned.  An example that fits this is <code>analyticsdcs.ccs.mcafee.com.</code></p>\n\n<ol>\n<li>Check for an NS record</li>\n</ol>\n\n<p><code>host -t NS analyticsdcs.ccs.mcafee.com.</code></p>\n\n<ol start="2">\n<li>If no NS found, check for an SOA record</li>\n</ol>\n\n<p><code>host -t SOA analyticsdcs.ccs.mcafee.com.</code></p>\n\n<ol start="3">\n<li>If neither NS or SOA, do full recursive and take the last NS returned</li>\n</ol>\n\n<p><code>dig +trace analyticsdcs.ccs.mcafee.com. | grep -w \'IN[[:space:]]*NS\' | tail -1</code></p>\n\n<ol start="4">\n<li>Test that the name server returned works</li>\n</ol>\n\n<p><code>host analyticsdcs.ccs.mcafee.com. gtm2.mcafee.com.</code></p>\n'}]
['https://Stackoverflow.com/questions/38021', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/319/']