The information in this article applies to:
SUMMARY
By default, performing a Request.ServerVariables("REMOTE_HOST") in ASP returns a null value, which causes Internet Information Server (IIS) to return the value of REMOTE_ADDR, the IP address of the client. This is by design to increase performance for Web hosting. However, by changing a setting in the metabase, IIS performs a reverse DNS lookup and returns the host name of the client connecting. This metabase entry has no affect on the information written to the IIS logs or on the IP restriction reverse lookup. Scripting Download PageThe command-line method requires that instructions be issued from a command prompt where the Adsutil.vbs script is located. The location of the Adsutil.vbs script depends on the version IIS, but is in the following directories by default:
Because improperly modifying the metabase can negatively impact Internet Information Server, Microsoft strongly recommends backing up the metabase before making any modifications.Example 1 - Enabling Reverse Lookups for all sites:This ASP code example enables all Web sites to perform a reverse lookup when a Request.ServerVariables("REMOTE_HOST") is issued. Due to the hierarchical design of the metabase, Web sites that do not explicitly have the EnableReverseDNS entry set inherit the value from the earlier node. ASP Method: Command-line Method:
Example 2 - Enabling Reverse Lookups for individual sites:This example enables a reverse lookup for a specific Web site when a Request.ServerVariables("REMOTE_HOST") is issued. Web sites are referenced in the metabase by an integer value. Because the Default Web Site is the first site created, it receives the reference number 1. This example enables reverse lookups for only the Default Web Site, to allow reverse lookups on other Web sites replace 1 in the following line:
with the numeric value of the Web site that needs to perform reverse lookups. The easiest way to determine the numeric value of a specific Web site is to look at the number listed at the end of the folder name where the log file name is specified. This can be accessed through the MMC/Internet Service Manager by selecting the Web site and choosing Action, Properties, Active Log Format and then Properties. The Default Web site's Log file name is W3SVC1\exyymmdd.log, corresponding to the /1/ROOT value. ASP Method: Command-line Method:
MORE INFORMATION
More information on the metabase can be found in the IIS documentation and in the article: Q240941 An Introduction to the IIS MetabaseMore information on the Scripting technologies listed in this article can be found at http://msdn.microsoft.com/scripting Additional query words:
Keywords : kbiis400 kbiis500 kbMetaBase |
Last Reviewed: November 24, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |