A lightweight, fast, and efficient in-memory index for public IP location data, designed for seamless integration with Docker.
The service can index the entire global IP network in about 200MB of memory, including the overhead of the ASP.NET server.
docker run --name lookup-ip -d lucascm14/ip-lookup:latest
GET /lookup/{ip_address}
Looks up the information for the given IP address.
- Status Code: 200 OK
- Content:
{
"city": "South Brisbane",
"region": "Queensland",
"country": "AU",
"latitude": -27.4767,
"longitude": 153.017
}
GET /
Returns general information and statistics for the application.
- Status Code: 200 OK
- Content:
{
"status": "SERVING",
"index": {
"ip_ranges": 3261621,
"distinct_info_count": 388806
},
"import_task": {
"start_time": "2024-06-26T21:01:12.2249912Z",
"duration": "00:00:17.8363821"
}
}
Environment Variable | Description |
---|---|
ImportTask__FileUri |
Sets the URI to the DBIP CSV file with IP location data |
- IPv6 Support: Add support for IPv6 as a configurable add-on to the IPv4 index.
- Scheduled Updates: Implement a feature to check for DBIP updates on a scheduled basis. Currently, the index is updated when the host restarts.
- Local Archive: Use a local archive if it exists and is up-to-date to avoid unnecessary downloads and reduce startup time.