RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Check domain name availability with bash and whois

The following bash script allows user to check for domain name availability using a whois utility ( Domain hijacking made easy ). User needs to only supply single or multiple keywords and the script checks domain availability for each keyword+domain-label. See below for a sample output.

Please feel free to add more generic domain labels into the list. However, test your whois server on what it returns if domain is available as not all whois servers return the exact string. I have tested only domains which are currently in the bash script below. When you get a string which your whois server returns when domain name is available, add it to the script's grep line starting with prefix"|". The chances are that if you add new domain name label the script will just work, but if not you know what to do.

Insert following lines into a file called check-domain-availability.sh


#!/bin/bash # Name: Check for domain name availability # linuxconfig.org # Please copy, share, redistribute and improve if [ "$#" == "0" ]; then echo "You need tu supply at least one argument!" exit 1 fi DOMAINS=( '.com' '.co.uk' '.net' '.info' '.mobi' \ '.org' '.tel' '.biz' '.tv' '.cc' '.eu' '.ru' \ '.in' '.it' '.sk' '.com.au' ) ELEMENTS=${#DOMAINS[@]} while (( "$#" )); do for (( i=0;i<$ELEMENTS;i++)); do whois $1${DOMAINS[${i}]} | egrep -q \ '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri' if [ $? -eq 0 ]; then echo "$1${DOMAINS[${i}]} : available" fi done shift done

Make script executable:

$ chmod +x check-domain-availability.sh

Execute script:

./check-domain-availability.sh lubos rendek

OUTPUT:

lubos.co.uk : available
lubos.net : available
lubos.mobi : available
lubos.tel : available
lubos.biz : available
lubos.cc : available
lubos.ru : available
lubos.in : available
lubos.it : available
lubos.com.au : available
rendek.co.uk : available
rendek.info : available
rendek.mobi : available
rendek.tel : available
rendek.biz : available
rendek.cc : available
rendek.ru : available
rendek.in : available
rendek.it : available
rendek.com.au : available

Share this linux post:

Submit Check domain name availability with bash and whois  in Delicious Submit Check domain name availability with bash and whois  in Digg Submit Check domain name availability with bash and whois  in FaceBook Submit Check domain name availability with bash and whois  in Google Bookmarks Submit Check domain name availability with bash and whois  in Stumbleupon Submit Check domain name availability with bash and whois  in Technorati Submit Check domain name availability with bash and whois  in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download