Quote:
Originally Posted by a thing
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....).
