Skip to content

Instantly share code, notes, and snippets.

@carsongee
Created October 2, 2014 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carsongee/9b5da2442d54a0ff6de6 to your computer and use it in GitHub Desktop.
Save carsongee/9b5da2442d54a0ff6de6 to your computer and use it in GitHub Desktop.
DNS Resolution Check
#!/bin/bash
hostname=example.com
while true; do
ip=$(dig +short $hostname | tail -n 1)
if [ ! -n "$ip" ]; then
echo "Failed at $(date)"
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment