0

I'm running Windows 10 x64 and I have a legacy application that doens't work fine with localhost being translated to ::1, but instead it works for 127.0.0.1.

How do I force Windows 10 to resolve localhost to 127.0.0.1?

I've already edited the hosts file putting the following line, but it doesn't work (ping still show ::1):

127.0.0.1 localhost
  • 1
    You can't fix the application? – Michael Hampton Nov 4 '16 at 20:12
  • @MichaelHampton unfortunately no, I can't. – user34295 Nov 5 '16 at 10:17
3

Remove IPv6, as your legacy application don't seem to support it.

Check the download there, it's a quick try easy to do:

How to disable IPv6 or its components in Windows

How to do it manually:

Manually disable or re-enable IPv6 or its components Disable IPv6 You can disable IPv6 on the host computer through the DisabledComponents registry value. The DisabledComponents registry value affects all network interfaces on the host.

Important Follow the steps in this section carefully. Serious problems might occur if you modify the registry incorrectly. Before you modify it, back up the registry for restoration in case problems occur.

To disable certain IPv6 components, follow these steps: 1. Click Start, type regedit in the Start Search box, and then click regedit.exe in the Programs list. 2. In the User Account Control dialog box, click Continue. 3. In Registry Editor, locate and then click the following registry subkey:

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

  1. Double-click DisabledComponents to change the DisabledComponents entry.

Note If the DisabledComponents entry is unavailable, you must create it. To do this, follow these steps: a. In the Edit menu, point to New, and then click DWORD (32-bit) Value. b. Type DisabledComponents, and then press Enter. c. Double-click DisabledComponents.

  1. Type any of the following values in the Value data field to configure the IPv6 protocol to the intended state, and then click OK: a. Type 0 to re-enable all IPv6 components (Windows default setting). b. Type 0xff to disable all IPv6 components except the IPv6 loopback interface. This value also configures Windows to prefer using IPv4 over IPv6 by changing entries in the prefix policy table. For more information, see Source and destination address selection. c. Type 0x20 to prefer IPv4 over IPv6 by changing entries in the prefix policy table. d. Type 0x10 to disable IPv6 on all nontunnel interfaces (both LAN and Point-to-Point Protocol [PPP] interfaces). e. Type 0x01 to disable IPv6 on all tunnel interfaces. These include Intra-Site Automatic Tunnel Addressing Protocol (ISATAP), 6to4, and Teredo. f. Type 0x11 to disable all IPv6 interfaces except for the IPv6 loopback interface.

Use the DisabledComponents registry value to verify whether IPv6 is disabled. To do this, run the following command at a Windows command prompt: reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents When you do this, you may receive the following error message:

ERROR: The system was unable to find the specified registry key or value. If you receive this error message, the DisabledComponents registry value is not set. If the DisabledComponents value is set, it overrides the settings in the connection properties.

Disable IPv6 on a specific network adapter You can do this by unbinding the adapter in the Local Area Connection Properties dialog box:1. Click Start, and then click Control Panel. 2. Click Network and Sharing Center. 3. In the View your active networks area, click Local Area Connection, and then click Properties. 4. On the Networking tab, clear the Internet Protocol Version 6 (TCP/IPv6) check box, and then click OK.

Note The Internet Protocol Version 6 (TCP/IPv6) check box affects only the specific network adapter and will unbind IPv6 from the selected network adapter. To disable IPv6 on the host, use the DisabledComponents registry value. The DisabledComponents registry value does not affect the state of the check box. Therefore, even if the DisabledComponents registry key is set to disable IPv6, the check box in the Networking tab for each interface can still be checked. This is expected behavior.

  • Thank you for helping. Wich one should I download? – user34295 Nov 5 '16 at 10:18
  • Try reading the More information section. It is important to understand as Microsoft doesn't test disabling IPv6. – John Mahowald Nov 5 '16 at 23:34
  • @user34295 its the first's one the left :) – yagmoth555 Nov 6 '16 at 2:54
  • @JohnMahowald of course the warning, Microsoft can't know where you will run that fixit. As some service need IPv6, like MSExchange, but we talk about a computer, and most of all the setting is reversible, you have the FixMe too to re-enable it too. – yagmoth555 Nov 6 '16 at 2:58
0

The only piece you should need to do is change the priority:

Open RegEdit, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters Create DisabledComponents DWORD registry value, set its value to 20 (Hexadecimal). See Microsoft KB 929852 for more info about this registry key, especially if DisabledComponents already exists on your system. Reboot.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.