LinuxQuestions.org
Visit Jeremy's Blog.
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, 08: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, 10:16 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,610

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


Reply

Tags
linux, nslookup, shell script, unix


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:22 AM
no ip from nslookup Tom Douglas Linux - Server 4 01-01-2008 04:47 PM
nslookup phsythax Linux - Software 5 11-19-2005 03:15 AM
Nslookup redhatlover Red Hat 3 05-08-2004 08:25 AM
nslookup ninen Linux - Software 1 05-23-2003 09:07 PM


All times are GMT -5. The time now is 04:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration