Skip to content

Common usage of dig command

install dig

apt install dnsutils
## or
yum install bind-utils

simple query

dig example.com

query with specific type

## query type is one of (a,any,mx,ns,soa,hinfo,axfr,txt,...) [default:a]
dig txt example.com

shorten the result

dig +short example.com

verbose the process

dig +trace example.com

specify DNS server

dig @114.114.114.114 example.com

how-dns-works.png

reference

  • https://aws.amazon.com/route53/what-is-dns/
  • https://www.cloudflare.com/learning/dns/what-is-dns/
  • https://www.verisign.com/en_US/website-presence/online/how-dns-works/index.xhtml

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App