LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-05-2014, 07:38 AM   #1
shruti_vip
LQ Newbie
 
Registered: Dec 2006
Posts: 2

Rep: Reputation: 0
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
 
Old 11-05-2014, 09:16 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
dig lets you set a timeout on queries and a limit on the number of retries.
 
  


Reply

Tags
linux, nslookup, shell script, unix



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nslookup!!! Please look up!!! anishkumarv Linux - Newbie 1 04-28-2011 12:22 AM
no ip from nslookup Tom Douglas Linux - Server 4 01-01-2008 03:47 PM
nslookup phsythax Linux - Software 5 11-19-2005 02:15 AM
Nslookup redhatlover Red Hat 3 05-08-2004 07:25 AM
nslookup ninen Linux - Software 1 05-23-2003 08:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration