IP Address Lookup
Look up IPv4 and IPv6 addresses: PTR, location from three databases, BGP routing and registry data straight from the RIR, in the browser or through an open API.
Since
2021
Part of
troubleshooting.tools
Technologies
The Challenge
Anyone investigating network problems or suspicious traffic needs more than a country for an IP address: the PTR record, who owns the range according to the registry, which autonomous system announces it and how reliable the location is. Many lookup sites show a single geolocation database as the truth, hide the source and leave reserved addresses as “unknown”.
The Solution
The tool answers every query in three levels that build on each other and names the source of every value. Three geolocation databases sit side by side, because they often disagree. Registry data comes live from the responsible RIR, routing from BGP data. Reserved and private ranges are explained with the RFC that reserves them. Every result has a stable link, and an open API returns the same data.
Three levels per query
Level 0: address
Is the address valid, public or reserved, and what is its PTR record (live via DNS)? Reserved ranges stop here: instead of location and registry, the answer names the RFC from the IANA special-purpose registries built into the code.
Level 1: location
Location from locally held data, with no request to third parties. The API answers from MaxMind GeoLite2; the web interface compares GeoLite2, DB-IP and IP2Location as tabs side by side, with an accuracy notice.
Level 2: registry and routing
The registry record comes live via RDAP from the responsible RIR, with a link to the source. Origin AS and announced BGP prefix come from the Team Cymru IP-to-ASN service.
Data sources
The three geolocation databases are held locally on the server and refreshed once a month by a scheduled job that reports failures. RDAP queries go to RIPE first and fall back to ARIN and APNIC, plus LACNIC and AFRINIC for IPv6. PTR records are live DNS queries.
Includes GeoLite2 data created by MaxMind (GeoLite EULA), DB-IP Lite (CC BY 4.0) and IP2Location LITE data available from lite.ip2location.com (CC BY-SA 4.0).
Open API
The API works without a key, account or paid tier. It answers in JSON, JSONP, XML, YAML, CSV, HTML, or plain text when no format is given; a curl without an address returns your own IP. Every well-formed request answers HTTP 200, errors are in the body, and partial answers are normal: location can come back while the registry is not answering. The rate limit applies per address and responds with HTTP 429.
Architecture
Plain PHP without a framework behind nginx, in one Docker image. Each tool consists of a config entry, a template, its own CSS and JavaScript and an API file; all share one layout, one router and one design-token stylesheet, and CI validators enforce that. Every route has a strict Content Security Policy with default-src 'none' and frame-ancestors 'none', all assets come from the site itself, and there is no CDN. The client's own IP is read only from the connection; forwarded headers sent by the client are ignored. Outbound queries are guarded and fail closed: a tool would rather answer 503 than send a request the wrong way.
Build and operations
GitLab CI with the stages test, build and deploy. Tests run on every branch and merge request: PHP lint, structure lint and validators for docs, design tokens, hidden attributes and CSP frames. Build and deploy run only on main; images are built with Docker-in-Docker, are immutable, and a deploy simply pulls the new image. Base images are pinned by digest, build tools by version and hash, and every image takes all OS package updates when it is built. A weekly pipeline updates library data. Structured API logs feed Grafana and Loki, and external uptime checks run from two locations.
Privacy
There are no accounts. Server logs contain IP, time, page, status and user agent. Analytics only with consent through self-hosted Matomo, with no cookie that recognises visitors. The Google map loads only after explicit consent; until then the page makes no request to third parties. The only cookie is the consent choice.
Results
A single lookup from 2021 has become a tool that brings location, registry and routing of an address together on one page, shows where the sources disagree and explains reserved ranges instead of leaving them blank. It is part of troubleshooting.tools, where all tools share layout, security rules and build pipeline.
Gallery
Screenshots of the public site with example addresses.