How to configure IIS 7.5 to use ipv4 IP addresses in log files

jkwasson used Ask the Experts™
I am running IIS 7.5 on Windows Server 2008 R2. I am using the W3C format log files. IIS is putting the IPV6 ip addresses in the log files, but I would like to see the IPV4 IP addresses instead. How can I configure IIS logging to use the IPV4 address instead of the IPV6 address?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I found the answer...

3.4 When using a function like GetLocalAddress to programmatically check web site’s IP or look into IIS 7.0 log, the result is “::1” instead of “” or a string like "fe80::e1ac:c656:a6bd:d619%10".  Why?  [top]

The result is expected. These are IPv6 addresses instead of IPv4. ::1 is the local loopback address of IPv6 which is corresponding to in IPv4 format.

By default, IPv6 is enabled on Windows 2008. If you want to disable it, go to Control Panel->Network and Sharing Center->Manage network connections. Uncheck IPv6 in your network connection's property. However, this will not disable the loopback interface of IPv6 which means http://localhost/ will still result in ::1. To fully disable all IPv6 interfaces on the server, we need to create and set DisabledComponents registry property to 0xffffffff under:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters .

and reboot the server. IE and IIS7 will start to use IPv4 addresses after this.


929852     How to disable certain Internet Protocol version 6 (IPv6) components in Windows Vista;EN-US;929852

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial