A simple PHP script to tell a visitor's IP address and more information. This file is supposed to be on a webserver and can be configured by renaming `config.php.sample` to `config.php`.
When the script is properly installed, one can visit/curl/wget the website to just receive one's public IP address. This is very useful in combination with other scripts (check out my snap-dyndns packages for example).
In order to use IPv4- and IPv6-only domains, you'll have to have control over the DNS nameserver records of your own domain.
- Set `ip.example.com` to be IPv4 (A Record) and IPv6 (AAAA Record) of your webserver
- Set `ip4.example.com` to only be the IPv4 address
- Set `ip6.example.com` to only be the IPv6 address
Make sure that the script is available through all those domains. Now your browser will use the default route for the `ip` subdomain, and the v4 or v6 route for the respective subdomains `ip4` and `ip6`.