Register
It is currently Wed Oct 22, 2014 3:43 pm

dnc - Domain Name Checker


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Tue Aug 01, 2006 12:38 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:

#!/bin/bash
# by Crouse -- Visit Bashscripts.org
# dnc - Domain Name Checker
# Created 08-01-2006
# Created for my own personal use. I do not guarantee the accuracy of results
# obtained through the use of this program.
if [ -z "$1" ] ; then
   echo " ";
   echo "      ######### COMMAND FAILED ########## ";
   echo "      USAGE: $0 domainnamenoextension";
   echo "      EXAMPLE: $0 bashscripts";
   echo "      In the example the bashscripts domain name is checked for";
   echo "      availability. bashcripts.com, bashscripts.net, bashscripts.org, bashscripts.us are all checked.";
   echo "      ######### COMMAND FAILED ########## ";echo " "; exit
fi

echo ""
echo "======== DNC Started  ========";echo ""
domainname=$1
declare -a tld
# You can put other tld extensions into the array, just remember to
#  add more numbers to the "num" section for every new tld extension.... next num needed as shown would be 4.
tld=(.com .net .org .us .info)
for num in 0 1 2 3
   do
      digdomain="$domainname${tld[num]}"
      dig $digdomain | grep "QUERY: 1, ANSWER: 0," &>/dev/null
         if [ $? -ne 0 ]; then
            echo "$digdomain is registered"
         else
            whois =$digdomain | grep -i "Updated Date" &>/dev/null
               if [ $? -eq 0 ]; then
                  echo "$digdomain is registered"
                     else
                        echo -ne "$digdomain is " ;tput smso; echo "AVAILABLE"; tput rmso;
               fi
         fi
   done
echo "";echo "======== DNC Finished ========";echo ""
exit



Top
 Profile WWW  
 PostPosted: Tue Aug 01, 2006 3:45 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Noticed it fails on some .org names.... says they are AVAILABLE, but aren't .....

May need to modify the string it searches for.....


Top
 Profile WWW  
 PostPosted: Tue Aug 01, 2006 3:53 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!/bin/bash
# by Crouse -- Visit Bashscripts.org
# dnc - Domain Name Checker
# Created 08-01-2006
# Created for my own personal use. I do not guarantee the accuracy of results
# obtained through the use of this program.
if [ -z "$1" ] ; then
   echo " ";
   echo "      ######### COMMAND FAILED ########## ";
   echo "      USAGE: $0 domainnamenoextension";
   echo "      EXAMPLE: $0 bashscripts";
   echo "      In the example the bashscripts domain name is checked for";
   echo "      availability. bashcripts.com, bashscripts.net, bashscripts.org, bashscripts.us are all checked.";
   echo "      ######### COMMAND FAILED ########## ";echo " "; exit
fi

echo ""
echo "======== DNC Started  ========";echo ""
domainname=$1
declare -a tld
# You can put other tld extensions into the array, just remember to
#  add more numbers to the "num" section for every new tld extension.... next num needed as shown would be 4.
tld=(.com .net .org .info)
for num in 0 1 2 3
   do
      digdomain="$domainname${tld[num]}"
      dig $digdomain | grep "QUERY: 1, ANSWER: 0," &>/dev/null
         if [ $? -ne 0 ]; then
            echo "$digdomain is registered"
         else
            whois $digdomain | grep -i "Updated On" &>/dev/null
               if [ $? -eq 0 ]; then
                  echo "$digdomain is registered"
                     else
                        echo -ne "$digdomain is " ;tput smso; echo "AVAILABLE"; tput rmso;
               fi
         fi
   done
echo "";echo "======== DNC Finished ========";echo ""
exit


Top
 Profile WWW  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP