What is ASN targeting?
ASN targeting is choosing proxy exit IPs by Autonomous System Number, the number a regional internet registry assigns to one network operator such as an ISP or mobile carrier. Every routed IP address is announced by an ASN, so a request targeted at AS7922 leaves from an address on Comcast's network.
Updated
How autonomous systems and ASNs work
The internet is a mesh of separately run networks. A network that sets its own routing policy and exchanges routes with its neighbors over BGP is an autonomous system, and it is known by its number. IANA gives blocks of numbers to the five regional internet registries (AFRINIC, APNIC, ARIN, LACNIC and RIPE NCC), which assign them to operators in their region.
Early numbers were 16-bit; 32-bit numbers (RFC 6793) now run far past 65,535. The ranges 64512–65534 and 4200000000–4294967294 are reserved for private use (RFC 6996) and never appear as the origin of a public address.
An ASN is a routing identity, not a brand. One operator often runs several: a consumer broadband network, a mobile network, a business or backbone network, and others inherited from acquisitions. A small ISP that uses address space from its upstream network shows up under the upstream's ASN, not its own name.
Why target proxies by ASN
Country and city say where a visitor is. The ASN says whose network they are on, and some systems key on exactly that:
- Ad campaigns bought for the subscribers of one ISP or carrier, which serve only to addresses on that network.
- Offers, prices and landing pages shown only to one network's customers, such as bundled streaming or carrier billing.
- Fraud and rate-limit rules that score networks differently, so the same request is challenged on one ISP and accepted on another.
- Bug reports that read "it only fails on network X", which you can reproduce only from network X.
For most scraping and monitoring, country or city targeting is enough and keeps the pool of exits large. Add an ASN when the network itself is the variable you are testing.
How to find the ASN you need
Start from an IP address you know is on the network, such as one from a customer report or your own connection on that ISP. Team Cymru's whois service maps it to its ASN in one command:
whois -h whois.cymru.com " -v IP_ADDRESS"
# Returns: AS | IP | BGP Prefix | CC | Registry | Allocated | AS NameStarting from a name instead, search for the operator on bgp.he.net or RIPEstat, which list the prefixes each ASN announces. PeeringDB adds a network type such as Cable/DSL/ISP, NSP or Content. Pick the ASN whose prefixes are in your target country and whose type is access, not transit or hosting.
Well-known examples: AS7922 is Comcast in the United States, AS7018 is AT&T, AS3320 is Deutsche Telekom and AS2856 is BT. Large operators have more than one ASN, so confirm with a lookup rather than a list.
How to check that ASN targeting worked
Ask for an exit with the ASN on the proxy username, read the exit IP from an echo service, then look that IP up from your own connection:
# 1. The exit IP for a session targeted at AS7922 in the United States
curl -s -x http://YOUR_HOST:YOUR_HTTP_PORT \
-U "YOUR_USERNAME-country-us-asn-7922-session-check01:YOUR_PASSWORD" \
https://api.ipify.org
# 2. The network that announces it
whois -h whois.cymru.com " -v EXIT_IP"Repeat with five or ten session names and count how many exits match. ASN lookups agree across tools more often than city lookups, because they come from public routing tables rather than geolocation estimates. If an exit's ASN is wrong, the targeting is wrong; a wrong city may only be two databases disagreeing.
Common mistakes
- Writing the prefix. Some services take
AS7922, others only7922. TrueProxies takes digits only. - Picking a transit or business ASN. Operators that run separate backbone, business and consumer networks put household addresses in the consumer one.
- Expecting a city from an ASN. A national ISP's ASN covers the whole country. Add city targeting if the city matters.
- Narrowing too far. A city plus a small regional ASN can leave few exits or none. Start with country and ASN, check the exits, then add a city.
- Judging by one exit. Check several sessions before deciding the targeting works or fails.
ASN targeting on TrueProxies
Residential IPv4 Standard and Residential IPv4 Premium take an ASN on the proxy username as asn- plus digits, alone or with country, city or region (on Premium, send region or city, not both). Unlimited Bandwidth takes the same asn- option and also targets by country and city; Unlimited Pro targets by country and city, and Residential IPv4 Lite by country only. There is no targeting by ISP name: look up the ASN and send the number.
A malformed value, or asn on a service that does not offer it, is refused at once instead of falling back to an untargeted exit; over HTTP the 407 carries the reason in the X-Proxy-Reason header. A valid ASN with no exit free at that moment returns 503, a coverage miss that can succeed later. The connection reference lists every option, and each country guide lists the networks seen in our own tests.
Standard traffic packs are 1 GB for $1.10, down to $0.60/GB, and Premium 1 GB for $1.49, down to $1.00/GB.
Questions about ASN targeting
What is the difference between ASN targeting and ISP targeting?
ISP targeting picks exits by an operator's name; ASN targeting picks them by routing number. One ISP can run several ASNs, so ASN targeting is the more exact of the two. TrueProxies offers ASN targeting on Unlimited Bandwidth and Residential IPv4 Standard and Premium, and no targeting by ISP name.
Is ASN targeting the same as targeting a mobile carrier?
Only when the carrier's mobile network has its own ASN and the exits are on it. An ASN that a carrier uses for both fixed and mobile service can return fixed-line exits. TrueProxies Residential IPv4 exits are on residential ISP networks, and TrueProxies does not sell mobile carrier IPs.
How do I find the ASN of my own connection?
The TrueProxies IP leak test shows your public IPv4 and IPv6 addresses with their ASN. From a terminal, run whois -h whois.cymru.com " -v YOUR_IP" with your public address, or paste the address into bgp.he.net.
Why do IP databases show different names for the same ASN?
Registry records carry legal company names, while many databases use brand names or their own labels. Compare AS numbers, not names.
Does ASN targeting work with sticky sessions?
Yes. Add a session name to the same username and requests carrying it ask for the same exit within the ASN. On TrueProxies, Unlimited Bandwidth takes a session duration from 1 minute to 24 hours, Residential IPv4 Standard from 1 second to 24 hours and Premium from 3 minutes to 24 hours.