This article was previously published under Q164023
This article has been archived. It is offered "as is" and will no longer be updated.
When a Windows Sockets application calls gethostbyname() to resolve thelocal hostname to a list of IP addresses on a multihomed computer, the listmay be returned in an order that does not match the binding order displayedin Control Panel, or the order that IP addresses were assigned to networkinterface cards (NICs).
Changes made to support Windows Sockets 2 produced this behavior.
To resolve this problem, obtain the latest service pack for Windows NT 4.0 or Windows NT Server 4.0, Terminal Server Edition. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
152734 How to Obtain the Latest Windows NT 4.0 Service Pack
When the new fix is applied, and gethostbyname() is used to resolve thelocal hostname on a multihomed computer, the list of IP addresses will bereturned 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 fromeach NIC (1,4) and then the remainder from each NIC (2,3,5,6).
Microsoft has confirmed that this is a problem in Windows NT 4.0 and Windows NT Server 4.0, Terminal Server Edition. This problem was first corrected in Windows NT 4.0 Service Pack 4.0 and Windows NT Server 4.0, Terminal Server Edition Service Pack 4.
For additional information about this issue, please see the followingarticle in the Microsoft Knowledge Base:
ARTICLE-ID: 171320 TITLE : How to Change the IP Address List Order Returned
To Change the order that addresses are returned:
1. Open Network Control Panel
2. Choose the bindings tab
3. Choose all protocols in the Show Bindings for drop down box
4. Expand the TCP/IP protocol
5. Addresses are tied to the specific Network Card. Move the NICs up or down the list to get the desired order.
Use ipconfig /all at the command line to assist in correctly identifying the NICs.
RAS interfaces will appear as NDISWANx . The addresses that RAS servers and RAS clients use are also returned in the list. This can have some adverse effects on applications that are not written to try other addresses when the first returned address fails.