Avatar of ciscosupp
ciscosupp

asked on 

NSLOOKUP Question

How can I run
nslookup www.google.com 
100x via cmd and log it to a text file.
* nslookupDNS

Avatar of undefined
Last Comment
Shaun Vermaak
ASKER CERTIFIED SOLUTION
Avatar of skullnobrains
skullnobrains

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ciscosupp
ciscosupp

ASKER

I’m using windows option two works perfect but is there a way to log the output to a text file.
Avatar of skullnobrains
skullnobrains

same as in unix

nslookup > logfile 2>logfile

or do the equivalent on the for loop or the whole script
Avatar of skullnobrains
skullnobrains

btw i have no idea what you're expecting but you'll probably just poll the windows cache 99 times with that test
Avatar of ciscosupp
ciscosupp

ASKER

Thanks  skullnobrains
Try to test a DNS server which sometimes times out (DNS query times out)
Avatar of skullnobrains
skullnobrains

something along these lines should be better :

FOR /L %i IN (1,1,100) DO (
  nslookup -server SERVERADDRESS %.dummy.google.com
) > logfile 2>logfile

Open in new window

which should produce 100 NXDOMAIN responses
the complete dns chain is checked every time since none of the strings are cached
if you run it a second time, the first run will have preloaded the cache of the server so if results are much better, you know the problem lies upstream that server
SOLUTION
Avatar of Shaun Vermaak
Shaun Vermaak
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
DNS
DNS

The Domain Name System (DNS) is a hierarchical, globally distributed system responsible for associating the name of a computer, service or other resource into an IP address for connecting to the Internet or a private network. Most prominently, it translates domain names to the numerical IP addresses needed for the purpose of computer services and devices worldwide.

29K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo