INFO: HOSTS File and Multi-homed Machine Name Resolution (177075)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows NT 4.0
    • Microsoft Windows 95

This article was previously published under Q177075

SUMMARY

The HOSTS file as described in the following Knowledge Base article:

108295 TCP/IP Name Resolution

cannot be used to implement name resolution for multi-homed machines using the same name. However, it can be used to implement name resolution for multi-homed machines using different names to indicate each IP address of each Network Interface Card (NIC).

MORE INFORMATION

Given an understanding of the HOSTS file, you can map "friendly names" to IP addresses. However, each "friendly name" must be unique.

For example, you should be able to do:

myhost -> address1
myhost1 -> address1

but not:

myhost -> address1
myhost -> address2

As described in 108295, the HOSTS file is parsed at name resolution time to match the given "friendly name" to an IP address. This parsing only looks for a single match, so multiple entries using the same "friendly name" has no effect.

To implement name resolution for multi-homed machines, you need to use a unique "friendly name" for each NIC. This lends to unambiguous resolution of any given "friendly name" to a specific address, allowing applications and testing to target individual NICs.

Modification Type:MajorLast Reviewed:3/12/2004
Keywords:kbAPI kbinfo kbIP kbnetwork KB177075