Troubleshooting DNS Issues with dig (Domain Information Groper)

  1. By default, it queries A record.
    An A record is used to find the IP address of a computer connected to the internet from a domain name. From Linux terminal,

    manoj@local: dig greencodes.net
    
    ; <<>> DiG 9.11.3-1ubuntu1.8-Ubuntu <<>> greencodes.net
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29043
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;greencodes.net.               IN     A
    ;; ANSWER SECTION:
    greencodes.net.       600      IN     A    43.255.154.30
    
    ;; Query time: 118 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Mon Jul 01 12:18:18 +0545 2019
    ;; MSG SIZE  rcvd: 59

    Don’t waste time looking other info but except the Question and Answer Section.
    This extra info can be removed by +short

    manoj@local:dig greencodes.net +short
    43.255.154.30
  2. Sometimes there might be an issue with your ISP or with router. Most commonly if the DNS cache is still not cleared, the routers nearest to your computer might give old or non-updated information. Since the request starts with your local computer, with information from, /etc/resolv.conf, it uses the DNS server listed in that file. Many routers act as a DNS server or at least the DNS server of our ISP. To change the DNS server while doing query, so that a cached copy is not replied, we can explicitly define the DNS server with @DNS_SERVER as follow:
    dig @8.8.8.8 greencodes.net +short

    Here 8.8.8.8 is the ip address of Google DNS server and we explicitly used it to query of DNS question. The router or local ISP DNS server will not be used to query to reach out to the server.

  3. A Start of Authority record (abbreviated as SOA record) is a type of resource record in the Domain Name System (DNS) containing administrative information about the zone, especially regarding zone transfers.
    dig @8.8.8.8 greencodes.net SOA
  4. To get MX record which gives the information about where and how the emails are hosted, we can pass MX.
    dig greencodes.net MX

Leave a Reply

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

Enquire now

If you want to get a free consultation without any obligations, fill in the form below and we'll get in touch with you.