What is a Authoritative Name
Server?
Basically authoritative DNS means the place where the Domain is actualy hosted. For Eg. if Www.example1.com is hosted nameserver1 then the response from nameserver1 is known as authoritative
It's distinction between a nameserver that's an official nameserver for the domain you're querying, and a nameserver that isn't. Nameservers that aren't authoritative are getting their answers second (or third or fourth...) hand - just relaying the information along from somewhere else.
An authoritative answer comes from a nameserver that is
considered authoritative for the domain which it's returning a record for (one
of the nameservers in the list for the domain you did a lookup on), and a non-authoritative
answer comes from anywhere else (a nameserver not in the list for the domain
you did a lookup on).containing complete and accurate information, and therefore respected:
So, for example, If we do an
nslookup of maps.google.com we would get a response from one of my
configured nameservers. (Either from my ISP, or my domain.) It would come back
as non-authoritative because neither my ISP's nameservers, nor my own are in
the list of nameservers for google.com. They aren't Google's nameservers, so
they're not the authoritative source that creates the NS records.
The list of authoritative nameservers for Google is below (from whois.internic.net).
Domain Name: GOOGLE.COM
Registrar: MARKMONITOR INC.
Whois Server: whois.markmonitor.com
Name Server: NS1.GOOGLE.COM
Name Server: NS2.GOOGLE.COM
Name Server: NS3.GOOGLE.COM
Name Server: NS4.GOOGLE.COM
Non-authoritative nameservers
Non-authoritative nameservers get their NS records from the authoritative servers somewhere down the line.
The answer you've received is essentially a cached or forwarded response from your local DNS server. Basically, a non-authoritative name server is one that does not contain the records for the zone being queried; your local DNS is likely not going to have Google's name records, for example.
You can get the name servers that are authoritative for a given domain by running host -t ns example.com to retrieve the NS record for example.com.
In the case of Google, we see:
$ host -t ns google.com
google.com name server ns4.google.com.
google.com name server ns1.google.com.
google.com name server ns2.google.com.
google.com name server ns3.google.com.
If you subsequently run your nslookup command against one of those servers, you will get the authoritative answer:
$ nslookup www.google.com ns1.google.com
Server: ns1.google.com
Address: 216.239.32.10#53
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 173.194.43.49
Name: www.l.google.com
Address: 173.194.43.50
Name: www.l.google.com
Address: 173.194.43.48
Name: www.l.google.com
Address: 173.194.43.52
Name: www.l.google.com
Address: 173.194.43.51
If you're using nslookup, to get the NS record type, you can run something like this in interactive mode:
$ nslookup
> set querytype=ns
> google.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
google.com nameserver = ns3.google.com.
google.com nameserver = ns4.google.com.
google.com nameserver = ns1.google.com.
google.com nameserver = ns2.google.com.
Authoritative answers can be found from:
ns1.google.com internet address = 216.239.32.10
So, setting querytype=ns does what the above host command did.
What is a Recursive DNS
Server?
Basically the DNS server which is managed by ISP.
You might have been able to
guess what a recursive DNS server does by its name—it recurses, which means
that it refers back to itself. Recursive DNS nameservers are responsible for
providing the proper IP address of the intended domain name to the requesting
host. Recursive nameservers are like the phone operator looking up a phone
number from multiple phone books on behalf of the requesting party (the users’
computer on behalf of an application), some phone books will list just last
names, then other phone books exist per last name, and list first names.
For example, when making a
request to a website from your browser, the host (computer) will then make a
request to recursive DNS server to find the IP address associated with the
website; this is assuming your operating system and Web browser do not already
have a response cached. From there, the recursive server will check to see if
it has a cached DNS record from the authoritative nameserver, and still has a
valid time-to-live (TTL). If the recursive server does not have the DNS record
cached, it begins the recursive process of going through the authoritative DNS
hierarchy, which I will explain further down in this post.