zangw
zangw

Reputation: 48526

What is the different between 127.0.0.1 and ::1

Originally, there is one third library used in my legacy codes, and one IP address configuration for it. Its default value is localhost. For IPV4, we know, the value of localhost is 127.0.0.1.

However, I find this value changed to ::1. According to this, ::1 represents the localhost for IPV6 and whole address is 0:0:0:0:0:0:0:1.

Here are my questions:

Upvotes: 0

Views: 166

Answers (1)

Mihai Maruseac
Mihai Maruseac

Reputation: 21460

127.0.0.1 is an IPv4 address while ::1 is the equivalent IPv6 address.

There is no other difference beside the IP protocol version between the two. Semantically, they behave the same, as long as your stack supports both protocols.

Upvotes: 2

Related Questions