ipof is a shell tool which resolves hostnames to IP. It's IPv4- and IPv6-aware, and easy and simple to use. It uses the libc resolver, which supports /etc/hosts, can batch over lists of hostnames in files, gives a usable return code, and can be used interactively.