Can the order in which an entry is looked up at the DNS or the hosts (/etc/hosts) be specified on Linux?
E.g.: If I specify DNS then hosts then the name should be resolved using DNS first, and hosts on fail.
Generally this is done with the /etc/resolv.conf and /etc/nsswitch.conf files. For determining the order, look at the "hosts" line of nsswitch.conf.
nsswitch.conf is where you configure the name service switching. This is a pretty standard one from a Debian Lenny system:
resolv.conf lists your DNS servers and which domain names should be appended to the hostname by default. It's likely generated automagically by your DHCP client.