My /etc/nsswitch.conf handles that:
hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname
directs name resolution to files first (so any host in the /etc/hosts file will be used first) then the optional MS dns protocol, followed by the real DNS. The "myhostname" is a plugin to reach a NSS name cache... and is also optional. A suggested minimum is "files dns".
BTW: sometimes the "mdns4_minimal [NOTFOUND=return]" can be dropped as if there IS a windows domain controller it may not be responding - causing long timeouts before the system goes to using DNS directly.