Microsoft KB Archive/105998

= Cannot PING Computer on Last Line of HOSTS File =

Article ID: 105998

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows NT Advanced Server 3.1
 * Microsoft Windows NT Workstation 3.1
 * Microsoft Windows NT Advanced Server 3.1

-



This article was previously published under Q105998



SYMPTOMS
If you add an entry to the HOSTS file (for TCP/IP utilities) and then try to use the PING command to access that computer, you may receive the following error message:





CAUSE
This error message may be caused by not having a carriage return after the last line in the HOSTS file. This problem usually occurs only when you try to communicate with the computer on the last line of the HOSTS file, because the other lines should have carriage returns.

NOTE: There may be numerous other causes for this error message.



RESOLUTION
To avoid this error message, use Notepad (or any text editor) to edit the HOSTS file and add a carriage return to the last line. If you add a carriage return to the last line of the HOSTS file created above, the PING command works correctly.

For additional information on the HOSTS file in Windows NT, query on the following words in the Microsoft Knowledge Base:

hosts and windows and nt

For additional information on the troubleshooting TCP/IP connectivity with Windows NT, query on the following words in the Microsoft Knowledge Base:

tcp/ip and tshoot and windows and nt



Steps to Reproduce Problem
 Rename the HOSTS file in the winnt\system32\drivers\etc\ directory to HOSTS.OLD.

NOTE: After testing, be sure to rename HOSTS.OLD back to HOSTS.  Using Notepad, create a new HOSTS file with the following line: 127.0.0.1  test (Without a carriage return after "test.")  Save the file as HOSTS in the winnt\system32\drivers\etc\ directory. Open a Command Prompt and enter the following command: ping test 

You will receive the above error message.

Additional query words: prodnt

Keywords: kbnetwork KB105998

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.