Dig

I’m putting this here for my own sanity.

An extremely powerful command line tool is dig, unless you forget how to use it.

Here is a simple bash function that can be added to .bashrc so you don’t need to remember how to use it.

Usage: digit google.com

Output:

:~$ digit google.com
google.com.		101 IN MX 50 alt4.aspmx.l.google.com.
google.com.		101 IN MX 10 aspmx.l.google.com.
google.com.		101 IN MX 20 alt1.aspmx.l.google.com.
google.com.		101 IN MX 30 alt2.aspmx.l.google.com.
google.com.		101 IN MX 40 alt3.aspmx.l.google.com.
google.com.		1339 IN	TXT "v=spf1 include:_spf.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
google.com.		80 IN A	74.125.30.100
google.com.		80 IN A	74.125.30.101
google.com.		80 IN A	74.125.30.102
google.com.		80 IN A	74.125.30.113
google.com.		80 IN A	74.125.30.138
google.com.		80 IN A	74.125.30.139
google.com.		244 IN AAAA 2607:f8b0:4003:c03::66
google.com.		91454 IN NS ns4.google.com.
google.com.		91454 IN NS ns3.google.com.
google.com.		91454 IN NS ns2.google.com.
google.com.		91454 IN NS ns1.google.com.
# digit function
digit() {
	dig +nocmd $1 any +multiline +noall +answer
}
About Brian J Collins

Husband, Father, Technology Consultant, Crunched for time... Day to day, I do whatever I want , unless it's on my list of things I can't do.