Use of /etc/hosts files in resolving the dns name

Hello,

For what purpose /etc/hosts file is used.I mean how any request coming to a DNS server or a switch would know that which name and ip are configured in /etc/hosts files of a server?

Best regards,
Vishal

Hi,

The /etc/hosts file is local only to the server that it is on - other servers don't actually know about it.

It is used to allow the local server to identify other hosts on a network, it has generally fallen out of favour where there are comprehensive DNS services etc.

Regards

Dave

Because you have a file called in AIX /etc/netsvc.conf having a line like:

#
hosts = local, bind

meaning host name resolution is to use - or look /etc/hosts first, if not found search the DNS...

Hi,

What is your OS, as they have several variations of how they do this.

Regards

Dave