1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
# ipasn.net DNS API Reference
**Source:** Geoff Huston, APNIC Blog, 2026-02-09 \
**URL:** https://blog.apnic.net/2026/02/09/from-the-stupid-dns-tricks-department-ipasn-net/
---
## Overview
`ipasn.net` is a DNS-based IP address enrichment service built on PowerDNS with a plug-in backend. Unlike Team Cymru's `origin.asn.cymru.com`, it accepts IP addresses in natural (non-reversed) order and supports IPv6 addresses with standard colon notation. All queries use DNS TXT record lookups.
The backend assembles responses from three data sources: a current BGP routing table snapshot (origin AS and advertised prefix), a geolocation database (country code), and RIR statistics reports (registry, registration date).
---
## Query Protocol
All queries are issued via `dig +short TXT` (or equivalent DNS TXT lookups).
---
## Endpoints
### 1. Cymru-Compatible (Compact)
Returns a pipe-delimited string similar to Team Cymru's format, but with natural IP address order.
**IPv4:**
```
dig +short TXT <IPv4_ADDRESS>.origin.asn.ipasn.net
```
**IPv6:**
```
dig +short TXT <IPv6_ADDRESS>.origin6.asn.ipasn.net
```
**Response format:** `"<prefix> | <origin_asn> | <cc> | <rir> | <reg_date>"`
**Example (IPv4):**
```
$ dig +short TXT 216.88.0.0.origin.asn.ipasn.net
"216.88.0.0/14 | 3561 | US | arin | 1998-09-25"
```
**Example (IPv6):**
```
$ dig +short TXT 2401:2000:6660::.origin6.asn.ipasn.net
"2401:2000::/32 | 4608 | AU | apnic | 2007-06-19"
```
---
### 2. Full Detail (Pipe-Delimited)
Returns an extended pipe-delimited record with BGP, registration, org name, and RPKI/ROA data.
```
dig +short TXT <IP_ADDRESS>.ipasn.net
```
**Response format (fields separated by `|`):**
| Position | Field | Example |
|----------|-------|---------|
| 1 | Queried Address | `216.88.0.0` |
| 2 | Address Family | `IPv4` or `IPv6` |
| 3 | BGP Status | `ADVERTISED` |
| 4 | Advertised Prefix | `216.88.0.0/14` |
| 5 | Origin AS | `3561` |
| 6 | Org Name | `CenturyLink_Communications,_LLC` |
| 7 | Country Code | `US` |
| 8 | Country Name | `United_States_of_America` |
| 9 | RIR | `arin` |
| 10 | RIR Prefix | `216.88.0.0/14` |
| 11 | Registration Status | `assigned` |
| 12 | Registration Date | `1998-09-25` |
| 13 | ROV Status | `VLD` |
| 14 | ROA Prefix | `216.88.0.0/14` |
| 15 | ROA Max Length | `24` |
| 16 | ROA Origin AS | `3561` |
| 17 | ROA Trust Anchor | `ARIN` |
**Example:**
```
$ dig +short TXT 216.88.0.0.ipasn.net
"216.88.0.0|IPv4|ADVERTISED|216.88.0.0/14|3561|CenturyLink_Communications,_LLC|US|United_States_of_America|arin|216.88.0.0/14|assigned|1998-09-25|VLD|216.88.0.0/14|24|3561|ARIN"
```
---
### 3. JSON Output
Same data as endpoint 2, returned as a JSON object.
```
dig +short TXT <IP_ADDRESS>.json.ipasn.net
```
**Response fields:**
```json
{
"Address": "216.88.0.0",
"Class": "IPv4",
"BGP": "ADVERTISED",
"Advertised_Prefix": "216.88.0.0/14",
"Origin_AS": "3561",
"Org_Name": "CenturyLink_Communications,_LLC",
"CC": "US",
"CC_Name": "United_States_of_America",
"RIR": "arin",
"RIR_Prefix": "216.88.0.0/14",
"Reg_Status": "assigned",
"Reg_Date": "1998-09-25",
"ROV": "VLD",
"ROA_Prefix": "216.88.0.0/14",
"ROA_Maxlen": "24",
"ROA_AS": "3561",
"ROA_TAL": "ARIN"
}
```
Note: The DNS TXT response may span multiple strings that need to be concatenated before JSON parsing.
---
### 4. DNS Resolution + Lookup
Resolves a domain name first, then performs the IP enrichment lookup. Returns full detail format.
**Default (prefers AAAA/IPv6):**
```
dig +short TXT <FQDN>.dns.ipasn.net
```
**Force IPv4 (A record):**
```
dig +short TXT <FQDN>.a.dns.ipasn.net
```
**Examples:**
```
$ dig +short TXT www.potaroo.net.dns.ipasn.net
"2401:2000:6660:0:0:0:0:108|IPv6|ADVERTISED|2401:2000::/32|4608|..."
$ dig +short TXT www.potaroo.net.a.dns.ipasn.net
"203.133.248.108|IPv4|ADVERTISED|203.133.248.0/24|4608|..."
```
---
### 5. Individual Attribute Queries
Query a single field by inserting the attribute name before `ipasn.net`.
**Country Code:**
```
dig +short TXT <IP_ADDRESS>.cc.ipasn.net
```
Response: `"US"`
**RPKI/ROA Status:**
```
dig +short TXT <IP_ADDRESS>.rpki.ipasn.net
```
Response: `"VLD_216.88.0.0/14-24_3561_ARIN"`
---
## Query Pattern Summary
| Query Type | DNS Name Pattern |
|------------|-----------------|
| Cymru-compat (IPv4) | `<IPv4>.origin.asn.ipasn.net` |
| Cymru-compat (IPv6) | `<IPv6>.origin6.asn.ipasn.net` |
| Full detail | `<IP>.ipasn.net` |
| JSON output | `<IP>.json.ipasn.net` |
| DNS resolve (default) | `<FQDN>.dns.ipasn.net` |
| DNS resolve (force A) | `<FQDN>.a.dns.ipasn.net` |
| Country code only | `<IP>.cc.ipasn.net` |
| RPKI status only | `<IP>.rpki.ipasn.net` |
---
## Notes
- IPv4 addresses use natural dotted-quad notation (no octet reversal required).
- IPv6 addresses use standard colon-delimited notation (no nibble expansion or reversal required).
- Spaces in org names are replaced with underscores.
- ROV field values include `VLD` (valid ROA exists). Other possible values are not documented in the source material.
- The service runs on PowerDNS with a custom backend that dynamically generates responses rather than serving from a zone file.
|