nslookup [ -option ] [ name | - ] [ server ]
Nslookup is a program to query Internet domain name servers. Nslookup has two modes: interactive and non-interactive. Interactive mode allows the user to query name servers for information about various hosts and domains or to print a list of hosts in a domain. Non-interactive mode is used to print just the name and requested information for a host or domain.
To know A record of a domain, for example bizhat.com, do following
server14# nslookup > bizhat.com Server: 22.214.171.124 Address: 126.96.36.199#53 Non-authoritative answer: Name: bizhat.com Address: 188.8.131.52 >
It resolve the domain name to IP: 184.108.40.206, this is A Record of the domain.
In the result, you see Non-authoritative answer: because you not not asking IP of the domain from the DNS server that really serve (authoritative) the domain name.
To check directly with the authoritative name server (the name server that serve the domain name), you need to use "server FQDN-OF-DNS-SERVER".
server14# nslookup > server server10.hosthat.com Default server: server10.hosthat.com Address: 220.127.116.11#53 > bizhat.com Server: server10.hosthat.com Address: 18.104.22.168#53 Name: bizhat.com Address: 22.214.171.124 > exit server14#
Here you have noticed there is no "Non-authoritative answer:" in result. This is because you are directly asking for A Record IP from a DNS server that host the domain name.
server10.hosthat.com is the hostname of the server that serves DNS for the domain name bizhat.com
If you need to see MX record, you can use "set type=MX", to change back to A Record mode, do "set type=A"
server14# nslookup > set type=MX > bizhat.com Server: 126.96.36.199 Address: 188.8.131.52#53 Non-authoritative answer: bizhat.com mail exchanger = 0 mail.gawab.com. Authoritative answers can be found from: > exit server14#