Technotes

Technotes for future me

dig

Basic syntax

dig Hostname
dig DomaiNameHere
dig @DNS-server-name Hostname
dig @DNS-server-name IPAddress
dig @DNS-server-name Hostname|IPAddress type

List of DNS record types

TypePurposeExamples
AIPv4 IP address192.168.1.5 or 75.126.153.206
AAAAIPv6 IP address2607:f0d0:1002:51::4
CNAMECanonical name record (Alias)s0.blaataap.com is an alias is an alias for nothing
MXEmail server host namessmtp.blaataap.com or mx1.blaataap.com
NSName (DNS) server namesns1.blaataap.com
PTRPointer to a canonical name. Mostly used for implementing reverse DNS lookups8.8.8.8.in-addr.arpa
SOAAuthoritative information about a DNS zonesee below
TXTText recordsee below

query a different nameserver

dig @DNS-server-name Hostname
dig @DNS-server-name IPAddress

select the DNS query type

dig Hostname|IPAddress type
dig @ns-server-here Hostname|IPAddress type
dig Hostname|IPAddress type
dig [+options] @ns-server-here Hostname|IPAddress type

FIND THE IP ADDRESS (A) OF A HOSTNAME

dig blaataap.com
dig @dns.google.com blaataap.com
dig +short blaataap.com A

Set IPv4 or IPv6 query transport mode

dig -4 query ...
dig -6 query ...

Specify port number for dns query

dig -p {PORT} query
dig -p 53 @1.1.1.1 blaataap.com

Source: https://www.cyberciti.biz/faq/linux-unix-dig-command-examples-usage-syntax/

Last updated on 31 Jan 2021
Published on 24 Apr 2020
Edit on GitHub