What is the difference between /etc/hosts and /etc/resolv.conf? Also, is there a good documentation that explain all these configuration files.
Thank you. Bala
resolv.conf specifies the nameservers for resolver lookups, where it will actual use the DNS protocol for resolving the hostnames. Typically the
hosts file is used for administrative purposes such as backend and internal functions, which is substantially more isolated in scope, as only the local server will reference it it.
/etc/nsswitch.conf specifies the lookup order with the
If this does not answer your question, please clarify further.
Look at the following manpages:
resolv.conf specifies nameservers in order of search preference.
hosts overrides all nameservers by mapping urls/shortnames to IPs.
DHCP, this file is automatically populated with DNS record issued by
hosts: files dnsthen
/etc/hostsfile will be checked first for resolution, if domain is still un-resolvable, DNS will then be consulted.