Dig Deep DNS Codex
Without further ado, this is the documentation page for the Dig Deep DNS Toolkit. This page lists a description of each script as well as a sample of its usage and output. Use the navigation table below to jump to the relevant section of this page to read about each script. Be sure to check out the change log to find out what's been updated to see if any of the scripts have any new features or bugfixes that your current versions don't have.
Standard DDDNS Tools
These are the DDDNS Tools that are included in the Standard distribution of the DDDNS Toolkit.
checkdns
checkdns runs a series of digs to query for general DNS configuration information of a given domain. checkdns retrieves the nameservers as reported by the queried domain's registrar, the following information from the queried domain's DNS zone: IP address of the queried server (if a server is provided), NS records, nameserver IP addresses, Start of Authority with SOA comments, and IP addresses of domain.tld and www.domain.tld. checkdns is NOT a replacement for online DNS checking tools such as Leaf DNS or Into DNS; however, checkdns is faster to provide preliminary information to start from compared to Leaf DNS or Into DNS.
Syntax: checkdns <domain> [<server|IP>]
checkmx
checkmx retrieves the IP address of the provided hostname, a list of the provided hostname's MX records, and the IP addresses of each MX record. The IP address of the hostname can be used to compare the IP addresses that the MX record(s) resolve to to determine if the MX records point to the same server. This script has been deprecated by digmail, but it remains as a part of the tool kit for specialty uses.
Syntax: checkmx <domain> [<server|IP>]
digdeep
digdeep was the first script written for this toolkit. digdeep can dig across multiple hostnames for multiple DNS zone record types, and sort its output by record type or by hostname. If multiple record types and/or hostnames are provided, each list must be enclosed in "double quotes". Digdeep also supports {brace,expansion}, and the hostname must be "double quoted" as if it were a list, otherwise you'll get weird output. An optional server or IP address can be provided to query (the output examples provided below omit this additional argument). digdeep has an additional easter egg: 50% of the time, digdeep will output an additional humorous geeky quote at the end.
Syntax: digdeep <host|record> <record(s)> <hostname(s)> [<server|IP>]
Note for OS X users: If you are sentimentally attached to your neutered OS X version of sed, then this script is going to behave very awkwardly for you without modification. The easiest fix is to just delete the pipes through sed that are in the main loops of this script that do all the dirty work. I had to manually install GNU sed (as gsed) using MacPorts and create a symlink as /opt/local/bin/sed => /opt/local/bin/gsed
to fix this myself without removing the pipes to sed. (My primary system is a MacBook Pro. I have every right to rip on the very operating system that I develop on. :P)
digmail
digmail can be considered an "evolution" of checkmx. checkmx only retrieves the MX records of a given hostname and their IP addresses. digmail however retrieves a much larger set of mail DNS configuration information: IP address of the provided domain, the domain's MX records, IP addresses of the MX records, the SPF record of the provided domain, and the IP addresses of the following subdomains: mail, email, webmail, smtp, pop, & imap.
Syntax: digmail <domain> [<server|IP>]
echomx
echomx is a simple script that can echo the MX records of Google Apps Mail and GoDaddy Email. This script is only useful for recalling the MX records of these two services without looking them up online.
Syntax: echomx <google|godaddy>
rdns
Dig has a built-in flag for an rDNS lookup as dig -x ip.ad.dr.ess
. However, this lookup will only accept an IP address for its input. It is possible to use dig -x $(dig host.name.tld)
as a workaround, but this does not work at all if host.name.tld returns a CNAME first before an A record (IP address). rdns solves this issue. It can take any hostname as its input, get the IP address that the hostname resolves to (and filter out any CNAMEs), and then perform an rDNS lookup on the resultant IP address.
Syntax: rdns <hostname> [<server|IP>]
spfinfo
spfinfo is currently still in development. However, this script will be capable of retrieving a given domain's SPF record (if it has one) and provide a detailed breakdown of the policy defined in the SPF record.
Fooling Mode DDDNS "Tools"
The "tools" included in the Fooling Mode expansion aren't exactly useful tools per se. Rather, they are quick scripts that I wrote for the fun of it, that I sometimes use on my own. These scripts can be installed separately from the Standard distribution of the DDDNS Toolkit. The name "Fooling Mode" is a reference to a jingle that is used in the anime series Naruto whenever the show forgoes serious plot development to have some nonsensical (and sometimes non sequitir) fun.
cointoss
cointoss uses a pseudo random number generator (PRNG) to toss a coin n times. cointoss keeps internal count of how many times the coin lands on heads or tails, and outputs the winner of the toss. For values of n greater than 10, cointoss will also output a count of heads and tails.
Syntax: cointoss <number>
roll
roll uses a PRNG to roll n dice of x sides. roll takes its input in standard Table Top RPG die format: [n]dx. If n is greater than 1, roll will also output a total of all the rolls.
Syntax: roll <[n]>d<x>
rolld
rolld uses a PRNG to roll a single die of n sides. rolld is the precursor to roll.
Syntax: rolld <number>