Using ping still seems a way to resolve a hostname, following the systems nsswitch.conf order. That is, checking hosts file first. dig, nslookup and host command all go straight to DNS and bypass hosts file.
Another command for this is:
Code:
getent hosts <domain>
which follows the nsswitch order.