Skip to content

Instantly share code, notes, and snippets.

@petertoi
Created April 15, 2015 21:06
Show Gist options
  • Save petertoi/8f7e42b867cbb85ec47b to your computer and use it in GitHub Desktop.
Save petertoi/8f7e42b867cbb85ec47b to your computer and use it in GitHub Desktop.
List all DNS records in a domain using dig
#!/bin/sh
#
# Author: Peter Toi
# Source: https://gist.github.com/petertoi/8f7e42b867cbb85ec47b
#
# Usage 1: $ digall.sh # No argument will prompt for domain
# Usage 2: $ digall.sh domain # Skip the prompts by including the domain as an argument
if [ "$#" -eq 1 ]
then
domain=$1
else
echo "Domain (Ex: google.com): "
read domain
fi
dig +nocmd $domain any +multiline +noall +answer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment