Order to resolve an IP in the Linux system

Question:
Which order is used currently to resolve an IP address in the system?

Answer:
Check the /etc/nsswitch.conf file:

...
hosts:          files dns
...
Or run:
grep hosts /etc/nsswitch.conf
and in most cases since the files precede the dns option, it will first check host file