nslookup

To find IP of a domain, use

nslookup serverok.in

To find MX record for a domain, use

nslookup -q=mx serverok.in

To see TXT records, run

nslookup -q=txt serverok.in

Asking Authritative Name Servers

When you run nslookup, it checks with caching name servers, generally provided by your ISP. But these are not authoritative name servers for your domain name. These caching name servers cache any DNS result for several hours depending on TTL (Time To Live) value in a domain’s DNS zone. If you are debugging some DNS problems, you need to ask domains authoritative name servers, that you can find by taking whois of a domain name.

Here is an example

nslookup -q=a DOMAIN_NAME_HEARE AUTHORITATIVE_NAME_SERVER_HERE

If you take whois of serverok.in, you will see the domain use name servers

Name Server: elle.ns.cloudflare.com
Name Server: carl.ns.cloudflare.com

To find MX record of the domain, you can use

nslookup -q=mx serverok.in

But what you get is the cached result from a non-authoritative name server. To get an authoritative result, you need to use the following command

nslookup -q=mx serverok.in elle.ns.cloudflare.com

Here elle.ns.cloudflare.com is one of the name servers used by serverok.in, that you find from whois. You can use any of the name servers with the nslookup command.

What it does is, ask the name server elle.ns.cloudflare.com (authoritative name server) what is the MX record for the domain serverok.in

Install nslookup on ArchLinux
Find Reverse-DNS/PTR using dig, nslookup, host
How to verify rDNS (reverse DNS)/PTR Record

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *