This project is a PHP-based web service similar to WhatIsMyIP. It allows users to easily discover their public IP address and obtain detailed information about it, including geolocation data, ISP details, and WHOIS records for domain. The tool supports both IPv4 and IPv6, and features a responsive interface that makes it accessible on any device.
The project consists of three main files:
-
index.php
The landing page that:- Displays the visitor’s public IPv4 and IPv6 addresses.
- Offers a search form to lookup custom IP addresses or domain names.
- Provides API usage documentation and example code snippets in various programming languages.
-
config.php
A simple configuration file that stores the IPHub API key used to classify IP addresses.
Note: Replace'your_key_here'
with your actual API key. -
details.php
A detailed view page that:- Resolves an input (IP or domain) to an IP address.
- Retrieves geolocation data from ip-api.com.
- Uses IPHub to determine if the IP is residential or non-residential.
- Performs reverse DNS lookups.
- Queries WHOIS information for domain inputs.
- IP Info: Automatically retrieves and displays your public IPv4 and IPv6 addresses.
- Custom IP/Domain Lookup: Enter any IP address or domain name to view in-depth details.
- Geolocation Information: Displays country, region, city, ZIP, latitude, longitude, timezone, and ISP.
- IP Classification: Determines if an IP is residential or associated with hosting, proxy, or VPN services using IPHub.
- Reverse DNS Lookup: Retrieves the hostname (PTR record) for the IP address.
- WHOIS Data for Domains: Fetches WHOIS information by determining the appropriate server based on the domain’s TLD.
- Map Visualization: Uses Leaflet to display the IP location on an interactive map.
- API Endpoints: Provides multiple endpoints to access IP and geolocation data in various formats (plain text, JSON, JSONP).
- Web Server:
- Apache, Nginx, or any other server capable of running PHP.
- PHP Version:
- PHP 7.x or higher.
- PHP Extensions:
- cURL (for making API requests to IPHub).
- fsockopen (for performing WHOIS queries).
- JSON (usually enabled by default) for decoding API responses.
Follow these steps to download the latest release of the project and deploy it to your web server's public HTML directory.
- Go to the Releases page of the repository.
- Download the ZIP file for the latest release.
- Once the ZIP file is downloaded, extract its contents to a local directory on your computer.
- Access Your Server:
- Use an FTP client (e.g., FileZilla), SFTP, or your hosting control panel's file manager to connect to your web server.
- Navigate to the Public HTML Directory:
- Locate your server's
public_html
(or equivalent web root) directory.
- Locate your server's
- Upload Files:
- Upload all extracted files and folders from the release into the
public_html
directory.
- Upload all extracted files and folders from the release into the
- Open the
config.php
file in the uploaded project. - Replace
'your_key_here'
with your actual IPHub API key:define('IPHUB_API_KEY', 'your_actual_api_key_here');
- Open the
index.php
file in the uploaded project, and replace domainexample.com
with your own IP-API public service.
- IPHub API Key:
- Obtain an API key from IPHub.
- Configure the key in the
config.php
file by replacing'your_key_here'
with your actual API key.
- Geolocation API:
- The project uses ip-api.com to retrieve geolocation data.
- WHOIS Services:
- The application performs WHOIS lookups by connecting to appropriate WHOIS servers based on domain extensions.
- IP-API Service
- Bootstrap:
- Version 4.5.0 (used for responsive design and layout).
- jQuery:
- Version 3.5.1 (used for AJAX requests and DOM manipulation).
- Font Awesome:
- Version 6.4.0 (used for icons in the UI).
- Leaflet:
- Version 1.9.4 (used for interactive map visualization of IP locations).
- Ensure that your server's firewall settings allow outgoing connections on port 43 (required for WHOIS lookups).
- The project supports both IPv4 and IPv6 addresses.
- Verify that your PHP configuration allows external HTTP requests (e.g., via
allow_url_fopen
forfile_get_contents
).
Usage examples can be accessed at https://ip.ridho.my.id to display the front-end page for IP checking and VPN/Proxy detection.
You can also use the API with various formats:
- JSON Format: https://api.ridho.my.id/?format=json
- Full Format: https://api.ridho.my.id/?format=full
- Full JSON Format: https://api.ridho.my.id/?format=full-json
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! If you'd like to help improve this project, please follow these guidelines:
-
Fork the Repository:
Create your own fork of the project. -
Create a New Branch:
Use a descriptive name for your branch (e.g.,feature/new-feature
orfix/issue-description
). -
Commit Your Changes:
Make sure your commit messages are clear and descriptive. -
Submit a Pull Request:
Once your changes are complete, open a pull request detailing your modifications and the issues they address.
For major changes, please open an issue first to discuss what you would like to change.
Thank you for your contributions!
- ip-api.com: Thanks for providing the geolocation API used in this project.
- IPHub: Appreciation for the IP classification API and Proxy / VPN detection.
- Bootstrap, jQuery, Font Awesome, and Leaflet: Gratitude to the developers of these tools for making excellent front-end development libraries.