Fix for Gethostbyname() IP Address Order on Local Multihomed Mac

Last reviewed: March 12, 1998
Article ID: Q164023
The information in this article applies to:
  • Microsoft Windows NT Workstation version 4.0
  • Microsoft Windows NT Server version 4.0

SYMPTOMS

When a Windows Sockets application calls gethostbyname() to resolve the local hostname to a list of IP addresses on a multihomed computer, the list may be returned in an order that does not match the binding order displayed in Control Panel, or the order that IP addresses were assigned to network interface cards (NICs).

CAUSE

Changes made to support Windows Sockets 2 produced this behavior.

RESOLUTION

To resolve this problem, obtain the following fix or wait for the next Windows NT service pack.

This fix should have the following time stamp:

   10/07/97  11:51a                72,464 Mswsock.dll (Intel)
   10/07/97  11:51a                40,720 Rnr20.dll   (Intel)
   10/13/97  04:01p                20,240 Wsock32.dll (Intel)

   10/07/97  10:49a               115,472 Mswsock.dll (Alpha)
   10/07/97  10:49a                67,856 Rnr20.dll   (Alpha)
   10/13/97  02:59p                24,848 Wsock32.dll (Alpha)

When the new fix is applied, and gethostbyname() is used to resolve the local hostname on a multihomed computer, the list of IP addresses will be returned in the following order:
  • The first address from each NIC in the system. You can see the order in which they will appear by clicking the Bindings tab in the Control Panel Network tool.
  • The remainder of the IP addresses from each NIC. You can see the order in which they will appear by clicking the Bindings tab in the Control Panel Network tool.
  • Additional addresses, such as those dynmically assumed by a cluster server.

So if you had a computer similar to the following:

   Card A - Addresses 1,2,3
   Card B - Addresses 4,5,6

The order returned would be 1,4,2,3,5,6. That is, the first address from each NIC (1,4) and then the remainder from each NIC (2,3,5,6).

STATUS

Microsoft has confirmed this to be a problem in Windows NT version 4.0. A supported fix is now available, but has not been fully regression tested and should be applied only to systems experiencing this specific problem. Unless you are severely impacted by this specific problem, Microsoft recommends that you wait for the next Service Pack that contains this fix. Contact Microsoft Technical Support for more information.


Additional query words: ping gethostbyname localhost multihomed multi-
homed
Keywords : kbbug4.00 kbfix4.00 NTSrvWkst nttcp kbnetwork
Version : WinNT:4.0
Platform : winnt
Hardware : ALPHA x86
Issue type : kbbug
Solution Type : kbfix


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: March 12, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.