Windows: Using Hosts File to Access Web Sites with XP SP2

Previous Topic Previous Next Topic Next
Xoc Software
RVBA Conventions
Maya Calendar Program
Company Information
ASP.NET and Other Tips
.NET: Debugging Designer Features of a Custom Control in Visual Studio
.NET: Setting the Default Font in a Windows Mobile/Compact Framework Custom Control
.NET Fixing C# XML Comments so they Work in Windows XP SP2
.NET: Getting and Setting the Application Version Number
.NET: Getting the Path of the Executing Assembly
.NET: Retrieving Assembly Attributes
.NET: Setting the RootFolder to Other Values in the FolderBrowserDialog in .NET
.NET: Sizing Columns in a ListView Control in .NET
.NET: Using Remoting in .NET
ASP.NET: Constructing a Graphic on the Fly in ASP.NET
ASP.NET: Controlling Caching in ASP.NET Web Forms
ASP.NET: How to use the FrontPage Server Extensions with ASP.NET
ASP.NET: Seeing What is in the ViewState in ASP.NET Web Forms
ASP.NET: Using Forms Authentication in ASP.NET
ASP.NET: View Trace Information on your ASP.NET Web Pages
ASP: Create XML from an ADO query
ASP: Detect Incomplete Loads
ASP: Including an ASP.NET Web Page In a Classic ASP Web Page
ASP: Process .HTM Files with Scripts and Server Side Includes
ASP: QuickSort Algorithm
ASP: Retrieve all server variables from IIS
ASP: Send Email from Active Server Page
HTML: How to Create a Non-Scrolling Region in HTML
IE: Allowing Only Certain ActiveX Controls to Run in Internet Explorer
IIS: Creating a web site for testing in IIS Server
IIS: Creating Multiple Web Sites within IIS on Windows 2000 and Windows XP Professional
IIS: IIS/Visual InterDev Problems and Fixes
IIS: Redirect a domain such as to
SQL Server: Execute SQL Server Updategram
Web Design: Design for People with Disabilities
Web Design: Keep a Web Page out of the Google Cache
Windows: Get HTTP Header of a Web Page using Telnet
Windows: Testing Domain Names without DNS
Windows: Using Hosts File to Access Web Sites with XP SP2
Windows: Windows XP Command Line Tools
Windows Mobile: Reprogramming the Push-to-Talk Button on the AT&T Tilt

Other Xoc managed sites:

After upgrading to Windows XP SP2 (Service Pack 2), I started running into a problem with Internet Explorer (IE) and other things that use Internet Explorer settings, such as Visual Studio .NET, allowing me to get at my web sites. I am not completely sure if this really was a SP2 problem, but it seems that it is.

The problem manifests itself when I try to access a web site that is configured in the Hosts file (rather than DNS, found in \windows\system32\drivers\etc\hosts) to be able to get to the FrontPage server extensions, or other things where logon is required. It only seems to manifest itself with IE, as Mozilla can get to the same pages without problem.

When access is attempted, IE asks three times for a username and password. I provided a valid username and password, but after the third time, it reports an error: You are not authorized to view this page

I finally tracked down what the problem is. It seems that SP2 has tightened up the authentication requirements. The web page that finally gave me the solution is 294382 - Authentication may fail with "401.3" Error if Web site's "Host Header" differs from server's NetBIOS name . The solution is to run this script from the c:\inetpub\adminscripts directory:

cscript adsutil.vbs set w3svc/NTAuthenticationProviders "NTLM"

After running this, the problem magically went away.