View Single Post
Old Oct 3rd, 2006, 10:17 PM   #9
sarumont
Hobbyist Programmer
 
sarumont's Avatar
 
Join Date: Apr 2004
Location: /dev/urandom
Posts: 154
Rep Power: 5 sarumont is on a distinguished road
Send a message via ICQ to sarumont Send a message via AIM to sarumont Send a message via Yahoo to sarumont
Quote:
Originally Posted by a thing View Post
notroot@arthur[0:~]$ ping -c1 asdr.ear.baawer
PING asdr.ear.baawer (208.67.219.40) 56(84) bytes of data.
64 bytes from ip-208-67-219-40.n.opendns.com (208.67.219.40): icmp_seq=1 ttl=50 time=14.1 ms

--- asdr.ear.baawer ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 14.197/14.197/14.197/0.000 ms
notroot@arthur[0:~]$ echo $?
0
notroot@arthur[0:~]$
That clears things up a bit. Whether the domain exists or not has no bearing on OpenDNS's reply. That is quite crappy. Short of using your own DNS servers (or your ISP's), putting two and two together should work for you:

-'host' can resolve the IP of any FQDN given it
-'ping' can resolve the IP of any local DN (that you may specify in /etc/hosts)

host + ping + glue = solution

Edit:

Playing around a bit more with OpenDNS as my nameserver, it appears to only return its search server IPs when the domain is not found. This being the case, you can still solve this with one tool (ping) and some parsing of the results (if $IP is in $IPS_OWNED_BY_OPENDNS....).
__________________
"Time is an illusion. Lunchtime doubly so."
-the late, great Douglas Adams
sarumont is offline   Reply With Quote