Take the 2-minute tour ×

I am making an API call and that call requires Request IP address. I am using ServletRequest.getRemoteAddr() to get the IP of the request. For one user, getRemoteAddr() is returning IPv6 rather than IPv4 why is this??

From my understanding, IPv6 is extension to the IPv4, where users can choose to use IPv6 rather than IPv4. Does this means user or user's ISP is using IPv6? How does this work.... Also is there a way to get IPv4 equivalent?


share|improve this question
Err, when the remote address is an IPv6 address? –  EJP Jul 9 '12 at 23:34

1 Answer 1

up vote 3 down vote accepted

ipv6 is not an "extension" to ipv4, it's an alternative addressing scheme. whether a client is using an ipv6 or ipv4 address is up to the client's configuration alone (although the intermediaries between the client and your server will need to be compatible). there is no way to get an ipv4 "equivalent" to an ipv6 address as ipv6 addresses are not backwards compatible (on the flip side, though, there is a way to encode ipv4 addrs in an ipv6 compatible way).

share|improve this answer

Your Answer


