Closed jagehring closed 5 years ago
The client browser/app decides whether IPv4 or IPv6 is used and most apps will prefer IPv6 when available.
Some work-arounds:
You can disable IPv6 on your web server to force clients to use IPv4. (Quick and dirty.)
You can add IPv4-only and IPv6-only hostnames to your web server (e.g. ipv4.mysite.com and ipv6.mysite.com) and use AJAX calls to those hostnames to register the user's IPv4 and IPv6 address in your database.
You can wait for the IPv6 databases to become more accurate.
I typically use #2 on our websites.
Keep in mind though: IPv4 may be more accurate in your own situation, but this may be different for your website's visitors.
I'm using ipapi and if I go to there site it shows my IP with the right city. On my site, it is showing the ip6 version so my city is somewhere else. is there a way to get the same results as the ipapi site?