dnsip

A utility that ships with djbdns.

Simple IP address lookup:

dnsip beandog.org
208.111.40.179

WARNING when scripting

dnsip may leave a trailing space, which can cause problems in string comparison: