Reputation: 23
I need to find the canonical name of three websites using nslookup.
When I do nslookup -a google.es 8.8.8.8
the answer is non authoritative but I need an authoritative answer.
What can I do to have the canonical name of "google.es", "upc.edu" and "uoc.es" with an authoritative answer using nslookup?
Upvotes: 1
Views: 3877
Reputation: 2693
You're getting a non-authoritative answer because you're asking a recursive resolver (8.8.8.8) for the answer, not an authoritative server. In order to get an authoritative answer, you need to ask the server authoritative for whatever name you're looking up.
For example,. let's do google.es. I usually use dig, but here's nslookup in interactive mode.
To find the auth. servers for google.es, you can do an NS query for google.es:
$ nslookup
> set query=ns
> google.es
Server: 8.8.8.8
Address: 8.8.8.8#53
Non-authoritative answer:
google.es nameserver = ns2.google.com.
google.es nameserver = ns1.google.com.
google.es nameserver = ns4.google.com.
google.es nameserver = ns3.google.com.
Authoritative answers can be found from:
So now we have 4 different nameservers (ns[1-4].google.com) we could choose from to get an authoritative answer. I'm gonna do ns1.google.com in this example, but you could choose whichever one.
Here's sending an A query for google.es to ns1.google.com:
> set query=A
> server ns1.google.com
Default server: ns1.google.com
Address: 2001:4860:4802:32::a#53
Default server: ns1.google.com
Address: 216.239.32.10#53
> google.es
Server: ns1.google.com
Address: 2001:4860:4802:32::a#53
Name: google.es
Address: 172.217.2.3
You may find it helpful to read the answers to this ServerFault question for more details.
Upvotes: 1