Common dig Commands

CommandDescription
dig domain.comPerforms a default A record lookup for the domain.
dig domain.com ARetrieves the IPv4 address (A record) associated with the domain.
dig domain.com AAAARetrieves the IPv6 address (AAAA record) associated with the domain.
dig domain.com MXFinds the mail servers (MX records) responsible for the domain.
dig domain.com NSIdentifies the authoritative name servers for the domain.
dig domain.com TXTRetrieves any TXT records associated with the domain.
dig domain.com CNAMERetrieves the canonical name (CNAME) record for the domain.
dig domain.com SOARetrieves the start of authority (SOA) record for the domain.
dig @1.1.1.1 domain.comSpecifies a specific name server to query; in this case 1.1.1.1
dig +trace domain.comShows the full path of DNS resolution.
dig -x 192.168.1.1Performs a reverse lookup on the IP address 192.168.1.1 to find the associated host name. You may need to specify a name server.
dig +short domain.comProvides a short, concise answer to the query.
dig +noall +answer domain.comDisplays only the answer section of the query output.
dig domain.com ANYRetrieves all available DNS records for the domain (Note: Many DNS servers ignoreย ANYย queries to reduce load and prevent abuse, as perย RFC 8482).

Warning

Some servers can detect and block excessive DNS queries. Use caution and respect rate limits. Always obtain permission before performing extensive DNS reconnaissance on a target.