Find Which ISP or Carrier an IP Address Belongs To: Web, RDAP, Bulk
The most reliable evidence for which ISP an IP belongs to is two things: the registration record for the block the IP sits in (the netname and org in RDAP/whois), and the ASN that announces that block on the public internet. For a single IP, a web tool that shows both is enough. On a server, one curl against RDAP does the job. For hundreds or thousands of IPs, use an offline ASN prefix table.
The catch is that "ISP" means different things in different data sources. Below are the three approaches first, then how to decide when the results disagree.
What is the fastest way to check one IP?
Open cdnping's IP and environment check. By default it checks your current egress IP. The carrier-related results include:
- ASN and AS name: the autonomous system announcing the block. For example, AS4134 is China Telecom's backbone.
- Block registration info: pulled via RDAP, showing the address range, netname and registrant.
- IP type: datacenter, residential, mobile or Tor.
- Native IP or broadcast IP: whether the registered location matches where the block is actually announced. See native IP vs. broadcast IP for the concept.
The location part is the result of a vote among 11 geolocation databases, with a confidence score. Carrier and location are separate questions, and databases usually disagree more about location than about carrier. For why, see why 11 IP databases give different locations. If you first want to know what an IP can reveal at all, what your IP address actually reveals is the fuller introduction.
A web tool fits questions like "which network am I on right now?" To look up someone else's IP, an IP from a server log, or to get results in a script, use the command line.
How do you check from the command line: RDAP and whois?
Using RDAP (recommended)
RDAP is the successor to whois. It returns JSON with fixed fields, which suits scripting. rdap.org redirects the request to the regional registry responsible for the address (usually APNIC in the Asia-Pacific region):
# Replace the IP with the address you want to look up
curl -sL https://rdap.org/ip/203.0.113.10 | jq '{name, handle, start: .startAddress, end: .endAddress, country}'
To get the registrant name, read the vCard in entities:
curl -sL https://rdap.org/ip/203.0.113.10 \
| jq -r '.entities[]? | .vcardArray[1][]? | select(.[0]=="fn") | .[3]'
A few points:
- Always add
-L. rdap.org hands the request to the actual registry through HTTP redirects. nameis the netname from traditional whois. Chinese carrier blocks typically look likeCHINANET-XX,UNICOM-XXorCMNET, and the suffix is often a province abbreviation.- Reserved and private addresses such as
10.x,192.168.xand100.64.0.0/10return an IANA reserved record (the name often contains words like RESERVED or PRIVATE) or nothing at all. They never map to a carrier. Note that100.64.0.0/10is carrier-grade NAT (CGNAT) space. If it shows up on your router's WAN port, you are sharing a public egress with other people. For the effects, see do shared IPs and CGNAT hurt IP reputation?
Using whois
If your system has whois installed:
whois 203.0.113.10 | grep -iE '^(netname|descr|org-name|country|origin)'
The whois output format differs between registries, and you may get several nested records (a large allocation to a carrier, with a smaller sub-block assigned to a company). Read the most specific one, meaning the record with the smallest address range.
Looking up the ASN
Registration data answers "who was this block allocated to", and the ASN answers "who is announcing it now". You can use Team Cymru's public whois service:
whois -h whois.cymru.com " -v 203.0.113.10"
The output gives, in order, the AS number, IP, BGP prefix, country, registry, allocation date and AS name. Without a whois command you can use a DNS query instead (the IP is written in reverse order):
dig +short TXT 10.113.0.203.origin.asn.cymru.com
What an ASN is, and why it is worth more attention than a geolocation, has its own article: what is an ASN and how to look one up.
How do you look up thousands of IPs in bulk?
Calling RDAP one IP at a time runs into rate limits and is slow. For bulk work, use offline data:
- Download an IP-to-ASN prefix table. Common sources include the TSV from iptoasn.com, MaxMind's GeoLite2-ASN (requires an account), and BGP prefix data from RouteViews. Pick one that updates automatically on a schedule.
- Do longest-prefix matching. One IP can fall inside both a /16 and a /24. Take the one with the longest mask.
- Map ASNs to the carrier categories you care about. In practice you rarely need tens of thousands of AS names, just a few classes such as "Telecom / Unicom / Mobile / education network / cloud provider / other". Maintain your own ASN mapping table.
- Re-check a small number of hard cases against RDAP to confirm netname and registrant.
For a one-off batch of a thousand or two IPs, Team Cymru also supports bulk whois:
# ips.txt has one IP per line
(echo begin; echo verbose; cat ips.txt; echo end) | nc whois.cymru.com 43 > result.txt
A simple Python prefix-matching example (assuming you already have a CSV with prefix,asn,name columns):
import csv, ipaddress
nets = []
with open("prefix-asn.csv") as f:
for p, asn, name in csv.reader(f):
nets.append((ipaddress.ip_network(p), asn, name))
nets.sort(key=lambda x: x[0].prefixlen, reverse=True) # longest prefix first
def lookup(ip):
addr = ipaddress.ip_address(ip)
for net, asn, name in nets:
if addr.version == net.version and addr in net:
return asn, name
return None, None
For large datasets, replace the linear scan with a radix tree or binary search over ranges. This only illustrates the logic.
How do China's big three carriers and common networks map to ASNs?
China's mainland has three major carriers: China Telecom, China Unicom and China Mobile. The table below lists the ASes you will meet most often when looking up Chinese IPs, to translate an ASN into the name people commonly use:
| ASN | Common name | Notes |
|---|---|---|
| AS4134 | China Telecom 163 backbone | Telecom home broadband, most Telecom IDCs |
| AS4809 | China Telecom CN2 | Telecom premium network, common for enterprise lines and some IDCs |
| AS4837 | China Unicom 169 backbone | Unicom home broadband and most Unicom IDCs |
| AS9929 | China Unicom A network | Unicom premium network |
| AS9808 | China Mobile | One of the ASes commonly seen for Mobile home broadband and mobile networks |
| AS58453 | China Mobile International (CMI) | Mobile's international egress network |
| AS4538 | China Education and Research Network (CERNET) | Universities and research institutions |
| AS37963 / AS45102 | Alibaba Cloud | Mainland China / outside mainland |
| AS45090 / AS132203 | Tencent Cloud | Mainland China / outside mainland |
This table only covers the most common cases. Provincial carriers, local cable operators and secondary ISPs have their own ASes or simply use their upstream carrier's address space. For the differences between the CN2, 9929 and CMI routes, see CN2 GIA, 163, 9929 and CMI explained.
Registry, ASN and the web tool's "ISP" disagree: which one do you trust?
There are three common kinds of disagreement.
1. The registrant is A, but the announcing ASN is B. The block is registered to A but announced by B's network. A may have leased or delegated the block to B, or A may be B's customer. To decide whose network the traffic runs through now, look at the ASN. To decide who owns the block and who to contact about abuse, look at the registration data.
2. The ASN is a backbone carrier, but the registration names a company. Large carriers often reassign small blocks to enterprise customers, and the most specific RDAP record shows the customer's name. Saying "this is a Telecom IP" and "this is a certain company's IP" are both correct, depending on which layer you are asking about.
3. The web tool shows an ISP name that matches neither. The "ISP" field in commercial IP databases is often the vendor's own normalized result. It may be a brand name, a downstream customer's name, or simply out of date. In that case, go with RDAP and BGP announcements, because those are primary data.
A practical order of precedence:
- Look at the ASN first, to see which network carries the block.
- Then look at the smallest-range RDAP record, to identify the direct user.
- Treat the ISP field from commercial databases as a reference only, and discard it when it conflicts with the first two.
Which cases are the easiest to get wrong?
Mobile networks. The public egress for mobile data is usually the carrier's CGNAT gateway. One public IP serves many users, and the egress may be in a different province from where you are. If the netname shows another province, that does not mean the geolocation is wrong.
Education networks. Many universities connect to both CERNET and commercial carriers, and the egress differs by destination. The same computer may show the education network when visiting site A and Telecom or Unicom when visiting site B.
Cloud providers and IDCs. A cloud server's IP belongs to the cloud provider in ASN terms, but which carrier's line it ultimately connects to cannot be read from the ASN alone. You need the route (the return path in traceroute). See how to read traceroute and mtr results. Also, a cloud provider's IPs are classed as datacenter IPs. For how they differ from residential IPs, see datacenter IP vs. residential IP.
Different IPv4 and IPv6 egress. On a dual-stack network, IPv6 may go straight out through the carrier while IPv4 takes another path, so it is normal for the two addresses to return different carriers. Be clear about which one you care about. For troubleshooting mismatched dual-stack egress, see IPv6 proxy not working: IPv4 and IPv6 egress mismatch on dual-stack networks.
Recently transferred addresses. After an IPv4 address changes hands on the market, the registration data, the BGP announcement and each IP database update at different times, so it is common for the three to disagree for a while.
A checklist you can follow
When looking up an IP's carrier, go through these in order:
- Confirm it is a public address (not
10/8,172.16/12,192.168/16or100.64/10) - Get the ASN and BGP prefix from Team Cymru whois or
/ip - Get the netname and registrant with
curl -sL https://rdap.org/ip/<IP>, using the most specific record - If the two agree: you have your conclusion
- If they disagree: record them separately as "ASN shows the carrying network, RDAP shows the direct user"
- Is it IPv6 or IPv4, and do you need to check both?
- For mobile, education network and cloud servers, add a note that the egress may not be local
If your goal is to troubleshoot your own network, for example to confirm that a proxy is working or that the egress is the one you expect, /ip shows the ASN, registration info, IP type and mainland China split-routing results in one pass, which is easier than running the commands separately. For how to read the split-routing results, see how Chinese websites see your real IP. The data sources and calculation methods behind each check are documented on the methodology page.