Skip to content

Instantly share code, notes, and snippets.

@ctrlaltdev
Created January 20, 2022 00:29
Show Gist options
  • Save ctrlaltdev/28d8bfd98a8c08dd6c656a69eb1ee7ac to your computer and use it in GitHub Desktop.
Save ctrlaltdev/28d8bfd98a8c08dd6c656a69eb1ee7ac to your computer and use it in GitHub Desktop.
Basic Bash Script to compare DNS records between the default NS and a provided one - used to make sure I copied all the records with the correct values before changing the NS servers
#!/usr/bin/env bash
DOMAIN=$1
NS=$2
TYPE=$3
ORIG_SOA=$(dig SOA $1 | awk '{print $5}')
COMP_SOA=$(dig SOA $1 @$2 | awk '{print $5}')
echo -en "$ORIG_SOA\t"
dig $3 $1
echo -en "$COMP_SOA\t"
dig $3 $1 @$2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment