Topic
1 reply Latest Post - ‏2009-12-11T16:25:05Z by pk.habi
Asimh
Asimh
1 Post
ACCEPTED ANSWER

Pinned topic dns records lookup

‏2009-10-09T23:28:36Z |
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
Updated on 2009-12-11T16:25:05Z at 2009-12-11T16:25:05Z by pk.habi
  • pk.habi
    pk.habi
    1 Post
    ACCEPTED ANSWER

    Re: dns records lookup

    ‏2009-12-11T16:25:05Z  in response to Asimh
    Hi Asimh,

    Not sure if you already got a solution for this.
    if not, what are are trying to achieve here?
    and also give some sample input