nslookup
Hi,
My requirement is from shell script I have to check whether nslookup is working or not.
For that I have written code like:
echo "Nslookup Start" >> /var/tmp/custominfo
if nslookup -type=AAAA vm1.vimfvt.com > /dev/null
then
echo "forwardlookup successful" >> /var/tmp/custominfo
else
echo "forwardlookup failed" >> /var/tmp/custominfo
fi
if nslookup -type=AAAA 2001:192:168:1::13 > /dev/null
then
echo "reverselookup successful" >> /var/tmp/custominfo
else
echo "reverselookup failed" >> /var/tmp/custominfo
fi
echo "Nslookup End" >> /var/tmp/custominfo
But most of the time it hangs and I only get output as Nslookup Start
Please let me know is there any other way where I can set some timeout to check if nsllokup is working or not.
Any help will be appreciated.
Thanks
|