INFO: HOSTS File and Multi-homed Machine Name Resolution

Last reviewed: November 21, 1997
Article ID: Q177075
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows NT 4.0 - Microsoft Windows 95

SUMMARY

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

   ARTICLE-ID: Q108295
   TITLE     : 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.

Keywords          : NtwkMisc NtwkTcpip
Version           : WINDOWS:95; WINNT:4.0
Platform          : Win95 winnt
Issue type        : kbinfo


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.