FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Home » Linux » Faster DNS Lookups

by comment

#!/bin/bash

HOSTS[0]=www.askapache.com
HOSTS[1]=s.askapache.net
HOSTS[2]=askapache.com
HOSTS[3]=www.google.com
HOSTS[4]=www.gnu.org
HOSTS[5]=www.google-analytics.com
HOSTS[6]=www.apple.com

NAMESERVERS[0]=208.67.222.222
NAMESERVERS[1]=208.67.220.220
NAMESERVERS[2]=65.24.0.168
NAMESERVERS[3]=65.24.0.169
NAMESERVERS[4]=8.8.8.8

for HOST in ${HOSTS[@]}; do
  echo; echo; echo "CHECKING $HOST LOOKUP TIMES"
  for NAMESERVER in ${NAMESERVERS[@]}; do
    host -t A -v $HOST $NAMESERVER|tail -n1|egrep -o '[0-9]+..*'
  done
done

208.67.222.222#53 in 18 ms
208.67.220.220#53 in 18 ms
65.24.0.168#53 in 23 ms
65.24.0.169#53 in 21 ms

Tags

Comments Welcome

Information is freedom. Freedom is non-negotiable. So please feel free to modify, copy, republish, sell, or use anything on this site in any way at any time ;)

My Online Tools

Popular Articles
Hacking and Hackers

The use of "hacker" to mean "security breaker" is a confusion on the part of the mass media. We hackers refuse to recognize that meaning, and continue using the word to mean someone who loves to program, someone who enjoys playful cleverness, or the combination of the two.
-- Richard M. Stallman


It's very simple - you read the protocol and write the code. -Bill Joy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

+Askapache | htaccess.io | htaccess.guru

Site Map | Contact Webmaster | License and Disclaimer | Terms of Service | @Htaccess

↑ TOPMain