How IP Geolocation Works: From Autonomous Systems to Privacy Implications
This article explains the technical principles behind IP‑based location services, describing how autonomous systems (ASNs) map IP blocks to organizations and regions, and discusses the privacy concerns and real‑world applications of IP geolocation in modern internet platforms.
To comply with national regulations, Chinese internet platforms such as Weibo, Douyin, and public accounts now display IP‑based location information, prompting the question of how IP addresses are mapped to geographic locations and what the underlying technology is.
How to Find an Address Using an IP?
IP addresses themselves are not directly tied to physical locations; instead, they are linked to Autonomous Systems (AS), which are large network blocks that connect to the Internet. Each AS has a unique identifier called an ASN.
An AS can be thought of as a town post office: it controls a specific range of IP addresses and routes traffic to the correct destination, similar to how a post office delivers mail within a town. Typically, an AS is operated by a single large organization such as an ISP, a tech company, a university, or a government agency.
The logical chain can be expressed as:
IP address → address block → Autonomous System Number (ASN) → organization → country
Using this chain, an IP address can be resolved to a coarse location (e.g., Beijing Chaoyang District or Shenzhen Nanshan District). For example, an IP belonging to the ASN AS4xxx is assigned to China Telecom, indicating a location in Shenzhen, China.
However, ASN‑based lookup usually only provides county‑ or district‑level granularity; finer details require additional records. Law‑enforcement agencies can obtain precise allocation records from ISPs, but such access is restricted to authorized investigations.
IP Address Privacy Issues
Beyond ISPs, many internet services collect IP‑location data to infer users' approximate positions. Services like Baidu Maps and Google use SDKs or web APIs to map IPs to locations, sometimes achieving accuracy within a few hundred meters. Users can often disable this tracking, but the data may still be inferred from nearby Wi‑Fi, Bluetooth, or network activity.
Even when a VPN masks the public IP, apps may still approximate a user's location by correlating signals from neighboring devices or by analyzing local network scans. Granting apps permission to scan local devices can expose IP addresses, MAC addresses, Wi‑Fi SSIDs, and other identifiers, which are then aggregated for targeted advertising or other commercial purposes.
References
What is an Autonomous System? | What is an ASN? – Cloudflare
How precise can IP geolocation be and how to protect privacy? – Zhihu answers
How precise can IP geolocation be and how to protect privacy? – Zhihu answers
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.