Skip to content

Instantly share code, notes, and snippets.

@anvius
Last active May 4, 2018 09:09
Show Gist options
  • Save anvius/6baf9210e5368019e4c00e69b0f58d55 to your computer and use it in GitHub Desktop.
Save anvius/6baf9210e5368019e4c00e69b0f58d55 to your computer and use it in GitHub Desktop.
To know if domain has dns active.
#!/usr/bin/env bash
v=`whois $1 | grep match | wc | awk '{print $1}'`
if [ $v = 0 ];
then
echo "$1 is taken"
else
echo "I don't know if $1 is taken"
fi
#!/usr/bin/env bash
n=`nslookup $1 1.1.1.1 | grep 'Name' | wc | awk '{print $1}'`
if [ $n = 0 ];
then
echo "I don't know if $1 is taken"
else
echo "$1 is taken"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment