nslookup

nslookup is a network administration tool for querying DNS servers. nslookup is very useful tool for debugging DNS record.

Query a domain name

Using the current ‘default’ DNS server:

# nslookup debian.org 
Server:         62.210.16.6
Address:        62.210.16.6#53

Non-authoritative answer:
Name:   debian.org
Address: 5.153.231.4

Using a specific DNS server:

# nslookup debian.org 8.8.8.8
Server:         8.8.8.8
Address:        8.8.8.8#53

Non-authoritative answer:
Name:   debian.org
Address: 5.153.231.4

Query the MX Record

# nslookup -query=mx debian.org 
Server:         62.210.16.6
Address:        62.210.16.6#53

Non-authoritative answer:
debian.org      mail exchanger = 0 muffat.debian.org.
debian.org      mail exchanger = 0 mailly.debian.org.

Here we have two MX (mail exchange) server for the zone debian.org

Query the NS Record

# nslookup -query=ns  debian.org 
Server:         62.210.16.6
Address:        62.210.16.6#53

Non-authoritative answer:
debian.org      nameserver = dns1.easydns.com.
debian.org      nameserver = debian1.dnsnode.net.
debian.org      nameserver = dns4.easydns.info.
debian.org      nameserver = sec1.rcode0.net.
debian.org      nameserver = sec2.rcode0.net.

The NS record give the domain’s authoritative DNS servers list.

Query the SOA Record

# nslookup -query=soa  debian.org 
Server:         62.210.16.6
Address:        62.210.16.6#53

Non-authoritative answer:
debian.org
        origin = denis.debian.org
        mail addr = hostmaster.debian.org
        serial = 2016092612
        refresh = 1800
        retry = 600
        expire = 1814400
        minimum = 600

The SOA record (start of authority) give information about the domain, it TTL, the e-mail address of the domain administrator, the domain serial number, etc…

Further Reading and sources