Skip to main content
Guides/Network & IP

ASN Prefixes: Understand and Use the Results

Get all IPv4/IPv6 prefixes announced by an ASN

EdgeDNS Team·Updated ·7 min read

ASN prefixes: the full list of IP addresses a network owns

An ASN prefix is one of the IP address blocks (in CIDR notation, like `1.1.1.0/24`) that an Autonomous System Number announces as belonging to its network. Every ASN on the internet typically owns dozens or hundreds of these prefixes. The full list is what gets exchanged through the BGP (Border Gateway Protocol) routing system, and it is the basis for how internet traffic actually finds its way from one network to another. When a packet for `1.1.1.1` leaves your computer, every router it passes consults its BGP table, finds the prefix `1.1.1.0/24` belongs to AS13335 (Cloudflare), and forwards the packet toward the next-hop router that announced that prefix.

You should care because ASN prefixes are how you build precise allowlists, blocklists, and routing decisions at the network level. If your security policy says "only allow traffic from AWS," you need the full list of AWS-owned prefixes to translate that policy into a firewall rule. If you want to identify all the IP addresses your competitor's hosting provider runs, you start with their ASN and pull every prefix. If you need to write a routing policy that prefers one peering relationship over another, you need to know which prefixes each ASN announces.

The five things every ASN prefix lookup returns:

  • The IPv4 prefixes. A list of CIDR blocks like `1.1.1.0/24`, `1.0.0.0/24`, `104.16.0.0/12`.

  • The IPv6 prefixes. A separate list for IPv6, like `2606:4700::/32`.

  • The total address count. A `/24` is 256 addresses, a `/16` is 65,536, a `/12` is over a million. This adds up fast. IPv6 totals routinely overflow a 64-bit integer and have to be returned as a string.

  • Announcement timelines. A `first_seen` / `last_seen` pair per prefix. A prefix that started being announced in the last few days is sometimes a sign of a new deployment, sometimes the fingerprint of a hijack — the timeline alone won't tell you which, but combined with RPKI status it usually will.

  • RPKI status per prefix. A `valid` / `invalid` / `unknown` verdict against published Route Origin Authorizations (RFC 6811). An `invalid` prefix is being announced by an AS that's not authorized to originate it — the canonical machine-readable signal of a BGP hijack or route leak.

Three questions an ASN prefixes lookup answers:

  • What is the complete list of IP addresses owned by this network?

  • Is this prefix legitimately announced by the right ASN, or is it being hijacked?

  • For a firewall allowlist, what is the smallest set of CIDR blocks that covers all of this provider's traffic?

The cost of guessing prefix ownership is firewall rules built on incomplete data. The fix is to query the routing data directly. The most useful public source is bgp.he.net, which exposes per-ASN prefix lists and historical data for free. For automated workflows, the regional internet registries (ARIN, RIPE, APNIC, LACNIC, AFRINIC) all publish daily snapshots.

The ASN Prefixes endpoint, in plain language

Get all IPv4/IPv6 prefixes announced by an ASN (Autonomous System Number)

Understanding the full IP (Internet Protocol address) footprint of an autonomous system is critical for security operations, threat intelligence, and network planning. Per-prefix RPKI status turns this into a hijack-and-leak detector — a prefix announced by an unauthorized AS is the canonical machine-readable signal of route hijacking (RFC (Request for Comments) 6811). Combined with `first_seen`/`last_seen` announcement timelines, the data needed for hijack alerting is in one response. Enables comprehensive blocklisting/allowlisting at the ASN (Autonomous System Number) level, attack surface enumeration, vendor IP space auditing, and peering capacity assessment. See RFC 6811 (BGP Prefix Origin Validation) and RFC 7908 (Route Leak Classification).

What is actually happening when you call it

Queries the RIPEstat Data API (Application Programming Interface) to retrieve all IP (Internet Protocol address) prefixes currently announced by the specified ASN (Autonomous System Number) in the global BGP routing table, then validates each prefix against published Route Origin Authorizations. Returns IPv4 (Internet Protocol version 4) prefixes with CIDR (Classless Inter-Domain Routing) notation, IP count (calculated as 2^(32-prefix_length)), name, description, `first_seen` / `last_seen` timestamps from the RIPEstat timeline, and `rpki` status. IPv6 (Internet Protocol version 6) prefixes include the same fields plus `total_ips_v6` as a decimal string (totals routinely overflow JS Number.MAX_SAFE_INTEGER). Also provides aggregate counts and total IPv4 address space. RPKI checks run with parallel concurrency-capped lookups; results are cached for 1 hour. Access differs by route: the query form /v1/network/ASN/prefixes?ASN= currently accepts Free API keys; the /v1/network/ASN/:ASN/prefixes path form and dedicated MCP (Model Context Protocol) tool require Developer or higher.

Why this specific tool matters

Choose a task: Threat Infrastructure Mapping. Given a malicious IP (Internet Protocol address), look up its ASN (Autonomous System Number) and then enumerate all prefixes to identify the full scope of potentially hostile infrastructure. Cross-reference with other threat feeds to build comprehensive blocklists at the AS level.

Run the ASN Prefixes request below and retain the input and observed result. Before changing configuration, compare the relevant fields with the value or policy you expected. Use the ASN Prefixes reference to check the field definitions and supported options.

Info:

Available on the developer plan. The technical details: `GET /v1/network/asn/prefixes`.

When would I actually use this?

Threat Infrastructure Mapping

Given a malicious IP (Internet Protocol address), look up its ASN (Autonomous System Number) and then enumerate all prefixes to identify the full scope of potentially hostile infrastructure. Cross-reference with other threat feeds to build comprehensive blocklists at the AS level.

Use the finding: Complete ASN-level blocklisting based on threat intelligence, covering all IP (Internet Protocol address) ranges an adversary controls.

Dynamic Firewall Allowlisting

Build firewall allowlists based on a vendor's ASN (Autonomous System Number) prefixes (e.g., AS16509 for AWS, AS13335 for Cloudflare) rather than maintaining static IP (Internet Protocol address) lists that go stale.

Use the finding: Self-updating, maintainable allowlists that automatically adapt to BGP prefix changes without manual intervention.

Attack Surface Assessment

Enumerate all externally-routed IP (Internet Protocol address) prefixes for an organization's ASN (Autonomous System Number) to map the complete attack surface. Identify forgotten subnets, shadow IT, and infrastructure outside the scope of existing security controls.

Use the finding: Comprehensive external attack surface discovery backed by authoritative BGP routing data.

The easiest way: just ask your AI assistant

Connect the MCP server. Just ask in plain English:

Use network_asn_prefixes with asn=13335. Show the returned findings, identify unavailable evidence, and explain a useful next check.

Confirm the tool and inputs in the client before accepting its summary. For ASN Prefixes, use the response fields below to separate observations from recommendations.

Tip:

The dedicated MCP server is available on every plan. Individual tool access and request limits depend on your plan. Management categories and endpoints disabled for the tool catalog are not exposed through MCP.

The technical way: call it from code

This ASN Prefixes request uses the example inputs from its API contract. Replace YOUR_API_KEY with a key on the developer plan or higher; adapt the target to your task.

bash
curl --request GET 'https://api.edgedns.dev/v1/network/asn/prefixes?asn=13335' \
  --header "Authorization: Bearer YOUR_API_KEY"

Prepare inputs for ASN Prefixes

Start with the inputs below. Keep the same hostname, path, and options when comparing ASN Prefixes observations. The API reference contains the complete parameter contract, optional settings, and access requirements.

FieldTypeRequired?What it meansExample

asn

string

Yes

The Autonomous System Number (with or without "AS" prefix, e.g., "13335" or "AS13335")

13335

Interpret ASN Prefixes findings

Read these fields alongside the full response from your ASN Prefixes check. A missing value or failed lookup is different from a passing result. Keep returned errors and confidence or cache metadata when available; do not replace missing evidence with a successful default. See the complete response reference for additional fields.

FieldTypeWhat you'll see in it

asn

number

The queried ASN (Autonomous System Number)

prefixes_v4

array

IPv4 (Internet Protocol version 4) prefixes: prefix (CIDR (Classless Inter-Domain Routing)), ip_count, name, description

prefixes_v4[].prefix

string

IPv4 (Internet Protocol version 4) prefix in CIDR (Classless Inter-Domain Routing) notation (e.g., 104.16.0.0/13)

Words you might be wondering about

IP (Internet Protocol address) — A unique number that identifies a computer on the internet, like a phone number for a server.

API (Application Programming Interface) — A way for one program to ask another program for something — like a waiter taking your order to the kitchen.

ASN (Autonomous System Number) — A unique number assigned to a big network operator (like an ISP or cloud provider). Tells you who owns a chunk of the internet.

CIDR (Classless Inter-Domain Routing) — A shorthand way of describing a range of IP addresses, like 192.168.1.0/24. The number after the slash says how many addresses are in the range.

IPv4 (Internet Protocol version 4) — The original kind of internet address — four numbers separated by dots, like 203.0.113.10. The internet has run out of new ones, which is why IPv6 exists.

IPv6 (Internet Protocol version 6) — The newer, longer kind of internet address. Looks like 2001:0db8:85a3::8a2e:0370:7334. Designed because the world ran out of IPv4 addresses.

RFC (Request for Comments) — The official internet standards documents. When someone says 'RFC 8484' they mean a specific numbered standards document — in that case, the one defining DNS over HTTPS.

MCP (Model Context Protocol) — An open standard that lets AI assistants — like Claude, ChatGPT, and Gemini — call real tools and read real data, instead of just guessing from what they were trained on.

Need Programmatic Access?

Automate domain intelligence with 100+ API endpoints and a free MCP server for AI integration.

ASN Prefixes: Results Guide | EdgeDNS