Tag: nslookup

  • 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

  • Dig

    Dig

    dig is a command line tool like nslookup used to check dns

    Find Reverse-DNS/PTR using dig, nslookup, host
    Requesting a zone trasnfer with dig

    Here is the basic usage

    dig DOMAIN_NAME
    

    dig have multiple sections, ANSWER SECTION is what you need to look for. After answer section, it shows some info about DNS server used to query.

    +short

    +short option allow you to just slow the answer.

    root@ok-vm:~# dig +short serverok.in
    104.28.18.89
    104.28.19.89
    root@ok-vm:~# 
    

    To find Specific Record type

    dig DOMAIN_NAME RECORD_TYPE
    

    Example

    root@ok-vm:~# dig +short serverok.in mx
    5 alt1.aspmx.l.google.com.
    5 alt2.aspmx.l.google.com.
    10 alt3.aspmx.l.google.com.
    11 alt4.aspmx.l.google.com.
    1 aspmx.l.google.com.
    root@ok-vm:~# 
    

    Dig show detailed info

    You can use +trace to get more detailed info on dig query.

    dig +trace RECORD_TYPE DOMAIN_NAME
    

    Example

    dig +trace ns boby.serverok.in
    

    See nslookup, dns