2

Can some one help me to read out the IPv6?

I tried this Working with IPv6 Addresses in PHP but it does not work for me..

There is no problem to get the IPv4 over

echo $_SERVER['REMOTE_ADDR'];

but can someone tell me how i get the IPv6?

This Site can read both (IPv4 and IPv6): http://ipv6-test.com/api/. But I try it without any api, is that possible?

Thanks

Community
  • 1
  • 1
Sebastian
  • 494
  • 5
  • 18
  • 34

1 Answers1

3

You have the right idea, but the request has to be made with IPv6 if you want an IPv6 address.

The site you link to probably works by having a page that loads resource from a server only accessible via IPv6. If it works, then you know the address.

I would just build a site that fires off AJAX requests to the same server, one via IPv4 and one via IPv6. Use its IP addresses to rule out any local DNS issues where IPv6 may not be supported.

Brad
  • 159,648
  • 54
  • 349
  • 530