Wazaterm » Linux Commands » dig

How to use dig Linux command

The dig (domain information groper) command is a flexible tool for interrogating DNS name servers. It performs DNS lookups and displays the answers that are returned from the name server(s) that were queried.

Installation

Debian ubuntu

    
      $ sudo apt install dnsutils
    
  

Usage

Perform basic DNS lookups with the specified name server (e.g. 8.8.8.8 )

    
      $ dig @8.8.8.8 www.wazaterm.com
    
  

Search for SPF records

    
      $ dig wazaterm.com txt
    
  

Perform IPv6 DNS lookups

    
      $ dig AAAA dns.google
    
  

Get hostname from IP Address(Reverse lookup)

    
      $ dig -x 8.8.8.8
    
  

Check MX record of the domain

    
      $ dig gmail.com MX
    
  

Perform basic DNS lookups

    
      $ dig www.wazaterm.com