LinuxQuestions.org
Review your favorite Linux distribution.
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 08-22-2015, 01:51 AM   #1
Hoxygen232
Member
 
Registered: Jan 2013
Posts: 37

Rep: Reputation: Disabled
Speed test for a list of DNS addresses


Hi,

I'm writing a unix script, I need a way to test the response time of a group of IP addresses (they are DNS addresses).
I was thinking I could you
Code:
dig google.com @[DNS_1]
but I should use it in a loop and I should get the
Code:
Query time:
in the result string and I don't know how to do that.

It would be nice if the script was able to get the DNS list from a simple file where each row is a DNS address.

How can I do that? Do you have any other idea?

Thanks

Last edited by Hoxygen232; 08-22-2015 at 03:28 AM.
 
Old 08-22-2015, 09:58 AM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,145
Blog Entries: 6

Rep: Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832Reputation: 1832
Code:
#! /usr/bin/env bash

#Add/subtract DNS here.
list=(
208.67.222.222 	#OpenDNS
208.67.220.220 	#OpenDNS
8.8.8.8 		#Google
8.8.4.4 		#Google
209.244.0.3 	#Level3
209.244.0.4		#Level3
68.94.156.1 	#ATT
68.94.157.1		#ATT
4.2.2.1 		#Verizon
4.2.2.2 		#Verizon
4.2.2.3			#Verizon
4.2.2.4 		#Verizon
4.2.2.5 		#Verizon
4.2.2.6			#Verizon
75.75.76.76		#Comcast
84.200.69.80	#DNSwatch
84.200.70.40	#DNSwatch
209.88.198.133	#Greenteam
195.46.39.39 	#SafeDNS
195.46.39.40	#SafeDNS
50.116.23.211	#OpenNIC
37.235.1.174 	#FreeDNS
37.235.1.177	#FreeDNS
8.26.56.26		#Comodo
8.20.247.20		#Comodo
74.82.42.42		#Hurricane
89.233.43.71	#Censur
91.239.100.100	#Censur
)

for i in ${list[@]}; do
	echo $i
	dig @"$i" bing.com | grep Query
	sleep 1
	echo '' 
done > dnstest.txt
 
Old 08-22-2015, 10:34 AM   #3
Hoxygen232
Member
 
Registered: Jan 2013
Posts: 37

Original Poster
Rep: Reputation: Disabled
thanks
 
  


Reply



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
Google, Facebook and Yahoo to test new net addresses Jeebizz Linux - News 0 01-13-2011 09:30 AM
faking IP addresses to test servers on an internal network danboland Programming 1 06-09-2009 04:22 PM
How to get a list of IP addresses currently on the network? puszikam Linux - Networking 22 12-14-2008 09:48 PM
Importing List of Addresses into IP Tables kaplan71 Linux - Security 9 12-08-2006 03:48 PM
List IP addresses stefaandk Linux - Newbie 2 07-26-2005 09:02 PM

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

All times are GMT -5. The time now is 01:35 AM.

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