Article ID: 183832 - Last Review: November 1, 2006 - Revision: 3.3

gethostname() Must Support Alternate Computer Names

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q183832
Expand all | Collapse all

SYMPTOMS

When you use the gethostname function in Windows NT, it does not support the ability to use alternate computer names for the computer.

CAUSE

The gethostname function returns the node name instead of the cluster name in the network name resource.

RESOLUTION

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 the Microsoft Knowledge Base:
152734  (http://support.microsoft.com/kb/152734/EN-US/ ) How to Obtain the Latest Windows NT 4.0 Service Pack

STATUS

Microsoft has confirmed this to be a problem in Windows NT Server, Enterprise Edition version 4.0. 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.

MORE INFORMATION

The change that was made in GetComputerName to support alternate computer names has been added to gethostname. GetComputerName checks an environment variable. If that variable exists, GetComputerName returns its value instead of the real computer name. The change was made to keep applications from breaking in a cluster.

APPLIES TO
  • Microsoft Windows NT Server 4.0, Terminal Server Edition
  • Microsoft Windows NT Server 4.0 Enterprise Edition
  • Microsoft Cluster Server 1.1
Keywords: 
kbhotfixserver kbqfe kbfix kbprb KB183832