Microsoft KB Archive/177075

{|
 * width="100%"|

INFO: HOSTS File and Multi-homed Machine Name Resolution

 * }

Q177075

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), included with:
 * the operating system: Microsoft Windows NT 4.0
 * Microsoft Windows 95

-

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

"Q108295 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 Q108295, 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.

Additional query words:

Keywords : kbnetwork kbAPI kbIP kbOSWinNT400 kbSDKPlatform kbOSWin95 kbGrpDSNet

Issue type : kbinfo

Technology : kbAudDeveloper kbWin32sSearch kbWin32API