WebTools

307 Useful Tools & Utilities to make life easier.

ASN Lookup

Identify and retrieve detailed information about Autonomous System Numbers (ASN), including organization names, countries, and assigned IP ranges.

Decoding the ASN Lookup Tool

Behind the scenes of the internet, Autonomous System Numbers (ASNs) act as the postal codes for large network operators. The ASN Lookup tool is designed to reverse-engineer network routing configurations by identifying the organizational and geographic details tied to either an IP address or an ASN prefix.

Dual-Mode Query Processing

The tool’s underlying PHP logic (built on Laravel Livewire) acts as a dynamic router based on your input. When a query is submitted, it first cleanses the data by stripping away common prefixes. If you input AS15169 or as15169, a regular expression (/^as(\d+)$/i) automatically isolates the numeric string 15169. Once the string is formatted, the application decides whether to treat the query as an IP address or an ASN.

1. IP Address Resolution

If the input passes PHP's strict FILTER_VALIDATE_IP check (which supports both IPv4 and IPv6), the tool routes the request to the ip-api.com JSON endpoint. It specifically requests fields including the geographic region, ISP name, organizational owner, and the ASN managing that IP block. The data is pulled over HTTP with a strict 5-second timeout to prevent the server from hanging on slow upstream responses.

2. Direct ASN Query & RDAP Parsing

If the input is not an IP address, the tool checks if the cleaned string is purely numeric. When confirmed, it attempts a direct lookup using the ARIN (American Registry for Internet Numbers) RDAP registry (rdap.arin.net/registry/autnum/). Because RDAP formats contact data as nested vCard arrays, the application traverses the specific array index (entities[0]['vcardArray'][1][1][3]) to extract the official organization name. It also extracts the registration date from the registry events.

The Fallback Mechanism: Because ARIN only holds data for North American allocations, queries for ASNs registered with RIPE (Europe), APNIC (Asia), or other Regional Internet Registries (RIRs) will return an error from ARIN. The tool anticipates this failure and gracefully falls back to the ipapi.co API. This secondary request retrieves the global ASN details, including the primary country of origin and the associated CIDR IP range (network prefix).

A Concrete Worked Example

Let’s walk through what happens when you query Google's primary ASN, AS15169:

  • Validation & Cleaning: The tool matches the regex /^as(\d+)$/i and reduces the input to 15169.
  • Routing: The input is not a valid IP, but it is numeric, triggering the ASN lookup path.
  • ARIN Lookup: The application sends an HTTP GET request to https://rdap.arin.net/registry/autnum/15169.
  • Data Extraction: The JSON response is processed. The handle translates to AS15169, the nested vCard array yields the organization Google LLC, and the events array yields the registration date.

Technical Considerations & Limitations

  • Timeouts & SSL: All external API requests are executed using Laravel's HTTP client with a hard limit of 5 seconds (Http::timeout(5)). Furthermore, SSL verification is explicitly disabled (withoutVerifying()) during the request to prevent local certificate issues from blocking the lookup.
  • Rate Limiting: Both ip-api.com and ipapi.co impose strict rate limits on free-tier usage. If the application hits these limits, the fallback mechanism may fail, resulting in an "ASN not found or service unavailable" error.

Frequently Asked Questions

Why does the tool accept inputs with or without the "AS" prefix?
The backend uses a case-insensitive regular expression (/^as(\d+)$/i) to strip the "AS" or "as" prefix before sending the query to the registries, allowing you to use either format freely.
What happens if I search for an ASN from outside North America?
The primary lookup queries ARIN (the North American registry). If an ASN is registered with RIPE, APNIC, or LACNIC, the ARIN lookup will fail. The tool will then automatically trigger a fallback request to the ipapi.co service to fetch the international data.
Why doesn't the IP range show up for all ASN queries?
The IP range (or network prefix) is only returned when the tool is forced to use its fallback mechanism (ipapi.co). If the primary ARIN RDAP lookup succeeds, the raw ARIN response does not include the aggregated IP range in a format the tool extracts, meaning that specific field will not be displayed.
Can I look up IPv6 addresses?
Yes. The tool validates IPs using PHP's native FILTER_VALIDATE_IP function, which successfully recognizes both IPv4 and IPv6 protocols before querying the IP geolocation service.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us