Websites sometimes classify a connection as a commercial VPN, proxy, Tor exit, hosting network, corporate gateway, or residential network. That classification is an estimate assembled from changing evidence—not proof of who the user is or what software is running on the device.
This guide is for site operators building risk controls. If you want to check your own current connection, use the interactive VPN detector instead.
Start With a Precise Classification Goal
VPN, proxy, and hosting are not interchangeable labels. Define the decision the classification supports before collecting signals. Fraud review, licensed-content location, rate limiting, and analytics quality have different costs for a false positive.
- Commercial VPN exit: an address currently associated with a consumer or business VPN service
- Open or managed proxy: an intermediary forwarding traffic for another client
- Tor exit: an address published in the Tor exit-relay consensus
- Hosting network: an address routed by a data-center or cloud provider, with no conclusion about its application
- Corporate or education gateway: many legitimate users sharing an organization-controlled exit
- Residential or mobile relay: traffic that appears to originate from consumer access space but may be relayed
Treat the Result as Probabilistic
Use labels such as observed, likely, unknown, and conflicting instead of presenting a binary result as fact. Preserve the supporting signals, their collection times, and their known limitations so a later review can explain the decision.
Signal 1: Maintained IP Intelligence
A maintained dataset can associate address ranges with known services, Tor exits, hosting networks, and anonymization infrastructure. Freshness and source provenance matter because providers add, remove, lease, and reassign addresses continuously.
- Record the dataset version or observation timestamp used for a decision
- Distinguish a directly observed service range from a broad hosting-provider label
- Support IPv4 and IPv6 independently
- Use more than one source when the decision has a high user cost
- Treat a missing record as unknown, not proof of a residential connection
Signal 2: Routing and Network Ownership
RIR registration, the routed prefix, and the origin autonomous system provide useful network context. They answer different questions: the organization registered for an address block may differ from the network currently announcing its route.
A hosting ASN can raise the likelihood of infrastructure traffic, but cloud networks also serve offices, security gateways, crawlers, and ordinary application servers. Review ISP and network ownership as context rather than a verdict.
Signal 3: Reverse DNS and Naming
A reverse-DNS hostname can contain a provider, region, product, or server role. It is weak evidence by itself: many addresses have no PTR record, naming conventions change, and generic words such as node or gateway are not specific to VPNs.
Signal 4: Account and Session Context
For abuse prevention, connection classification is more useful when combined with first-party context such as login velocity, impossible travel, device continuity, failed authentication, payment risk, or automation patterns. Collect only signals that are necessary and proportionate to the decision.
- A new network plus a known device may be routine travel
- A known network plus many unrelated accounts may indicate shared infrastructure or abuse
- Rapid country changes can be a VPN, mobile routing, travel, or stale geolocation
- Behavior should modify confidence, not retroactively turn a network estimate into a fact
Signals to Avoid or Constrain
- Do not scan arbitrary ports on a visitor address; it is intrusive, unreliable, and usually unrelated to the client route
- Do not treat a city mismatch as proof of a VPN because IP geolocation is approximate
- Do not silently initiate WebRTC or third-party network probes solely to discover additional addresses
- Do not equate every cloud-hosted address with malicious or anonymized traffic
- Do not infer a real-world identity from an IP classification
Geolocation errors are common enough to deserve a separate handling path instead of being folded into a VPN score.
Build an Explainable Confidence Model
A practical model can combine independently maintained signals while keeping their meanings separate. Avoid arbitrary rules such as two weak signals equal a confirmed VPN. Calibrate weights against labeled outcomes and expose a reason code for each decision.
- Observed: the exact address or prefix appears in a current, attributable service list
- Likely: multiple independent, recent signals support the same classification
- Possible: one broad or weak signal is present, such as hosting-network ownership
- Conflicting: credible sources disagree or the address recently changed use
- Unknown: available evidence is insufficient
Choose a Response Proportionate to Risk
Classification should be one input to a policy decision. A low-cost analytics adjustment can tolerate more uncertainty than denying account access or a financial transaction.
- Allow: no meaningful risk or the product permits privacy services
- Observe: retain a short-lived reason code for aggregate analysis
- Challenge: request step-up authentication when several risk signals align
- Review: send high-impact ambiguous cases to a documented review process
- Block: reserve for requirements that justify the user harm and support an appeal
Design for False Positives
Corporate gateways, universities, mobile carriers, satellite providers, security products, privacy relays, and carrier-grade NAT can resemble VPN infrastructure. Accessibility tools and restrictive networks can also route users through shared services.
- Show a neutral explanation rather than accusing the user of evasion
- Provide a retry or alternate verification route
- Offer an appeal for high-impact denials
- Log which rule produced the outcome
- Monitor false-positive rates by country, network type, IP family, and product flow
Evaluate a Classifier Correctly
Overall accuracy can hide serious problems when most traffic belongs to one class. Measure precision, recall, false-positive rate, and decision cost for each label. Use time-separated evaluation data so recently reassigned ranges do not appear in both training and test sets.
- Test IPv4 and IPv6 coverage separately
- Break out results by region and network type
- Measure performance on new or recently changed ranges
- Review disagreements between vendors instead of silently choosing one
- Recalibrate thresholds when traffic or provider infrastructure changes
Privacy, Retention, and Governance
An IP address and associated account activity can be personal data in many contexts. Document the purpose, minimize collection, limit access, define retention, secure vendor transfers, and obtain legal review appropriate to the jurisdictions and product involved.
- Store a coarse reason code when raw evidence is not required
- Expire transient network observations on a documented schedule
- Avoid reusing fraud signals for unrelated profiling without a valid basis
- Provide transparency that matches the real decision process
- Audit both vendor changes and internal policy changes
Keep Consumer Checking and Operator Classification Separate
A consumer-facing VPN check answers whether the current network resembles known VPN or hosting infrastructure. An operator classifier estimates risk for a defined product decision. Neither can prove that every device connection is protected, identify the person behind an address, or replace the VPN verification checklist.