0

When I ping localhost I can see that localhost name is resolved as :::1 instead of 127.0.0.1. Do you know how to solve this? I need a ipv4 resolution of localhost for Tomcat server.

I could quickly fix this with "127.0.0.1 localhost" to windows's hosts file, however I think can ben a better solution.

Tobia
  • 1,426

4 Answers4

1

Frankly, use the host file. The reason it exists is to fix problems like the one you describe and so there is no reason not to use it.

Disabling IPv6 is unsupported and will break functionalities (although nothing critical). It is a far more disruptive change than touching the host file.

Stephane
  • 6,482
0

You can disable IPv6 services if not use.

Enter the registry, find:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters

Add this:

  • Key: DisabledComponents
  • Type: DWORD
  • Value: 0xffffffff
cuonglm
  • 2,416
0

I would suggest to make tomcat listen on the ipv6 stack too. Normally it should, which version do you use ?

0

you'd need to change the resolution order in the prefix policy table. I suspect however that this will not solve whatever problem you are having since 127.0.0.1 is ::1. Is tomcat is not getting a response back on the v4 stack (if its trying to connect to localhost on v4) there is some other problem going on. unless you have unbound v4 from the NIC you will always get v4 answers from the v4 stack and v6 answers from the v6 stack

To do so in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters

Add (If it does not exist) Key: DisabledComponents as a DWORD (32-bit) Value

Next

1.Find the current value data of DisabledComponents. 2.Change the data to binary data. It will be a 32-bit binary value. 3.Find the sixth bit of the data, and then set it to 0. Do not change any other bits. For example, if the current data is 11111111111111111111111111111111, the new data should be 11111111111111111111111111011111. 4.Change the data from binary to hexadecimal. 5.Set the hexadecimal value as the new value data for DisabledComponents.

Jim B
  • 24,276