Skip to main content

developerWorks >  Linux  >  Forums  >  Linux scripting  >  developerWorks

dns records lookup    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 0 - Pages: 1 Threads: [ Previous | Next ]
Asimh

Posts: 1
Registered: Oct 09, 2009 07:23:31 PM
dns records lookup
Posted: Oct 09, 2009 07:28:36 PM
Click to report abuse...   Click to reply to this thread Reply
Hi.

#!/bin/bash

look=$( for i in $(cat list ); do nslookup $i | grep Address | grep -v -e "53" -e "Server" | cut -d ':' -f2; done; )

var1="1.1.1.1"

for abc in $look
do

if $abc = $var1 ; then

echo ""
echo "$abc - Ip is correct - "
echo ""
else
echo ""
echo "$abc - IP is not correct - "
echo ""
fi
done

I want the output like following.

1.1.1.1 - IP is correct example.com

Currect script only print output
1.1.1.1 - IP is correct -

Can any one help me to add domainname with the output.


Regards

 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums