shell script to print IP address details from the internet domain name


Situation :  shell script that allows a user to enter any Internet domain name (eg. google.com)  & Your script should than print out the IP address of the Internet domain name

Solution: create file name $touch sitenameip.sh and give excute permission to that file. copy the below code in that file.
####To get the domain ip address ####

echo ” Enter the site name:”

read site

host $site

#echo “Site IP Details is $site”

exit

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: