What a Website Really Knows About Your IP Address (And How to Check It Yourself)
TL;DR An IP address is a network-layer label, not an identity. Almost everything a website "knows" about you from it is inference: which organization announces the address (the ASN), a rough location from a geolocatio
TL;DR
- An IP address is a network-layer label, not an identity. Almost everything a website "knows" about you from it is inference: which organization announces the address (the ASN), a rough location from a geolocation database, and a guessed "type" (residential, mobile, datacenterβ¦).
-
Registry country β where packets enter β where the user sits.
1.1.1.1is registered to an Australian lab, announced by an American company, and served from whichever edge is closest to you. We'll prove that with twocurlcommands. - Browsers and terminals frequently reach the internet through different paths. "My
curlsays one thing and my browser says another" is usually a proxy-variable or routing issue, not a bug. - WebRTC and DNS are the two classic side channels that can show a path different from the one your HTTP traffic takes. They are easy to inspect yourself, and we'll do it with ~20 lines of code.
- No client-side checker can see a service's server-side risk model. Treat any "score" as a diagnostic hint, not a verdict.
This post is a practical tour, aimed at developers who have ever asked "why does this site think I'm somewhere else?", "why was my CI runner challenged with a CAPTCHA?", or "why do two lookup services disagree about the same IP?". Everything below can be reproduced with curl, nslookup/dig, a browser console and a short Python script.
1. Why a developer should care about this
You don't need to build anti-abuse systems to run into IP reputation. Typical symptoms:
- Sign-up or login works from your laptop but is challenged from a cloud VM or a CI runner.
- A documentation page, a download or an API returns a region-specific response, and the region is wrong.
- You test a geo-aware feature, and three different "IP lookup" websites give you three different cities.
- A request from your terminal and the same request from your browser are seen as different clients, with different IPs and even different countries.
- A mobile user's IP is "in another state", and your analytics say the audience is in the wrong place.
All of these come from the same fact: the IP address is the only identifying value the server is guaranteed to receive, but it says very little by itself. Everything else is derived by lookups, heuristics and cross-checks. Understanding those derivations makes debugging far less mysterious.
2. What the server literally sees
At the transport layer, a server sees:
client 198.51.100.23:51514 ββTCP + TLSβββΆ server 203.0.113.10:443
The source IP address (and port) of the connection is the one property the client cannot simply claim. Everything else, including HTTP headers like User-Agent, Accept-Language or Referer, is asserted by the client and can be set to anything.
Two practical consequences:
-
Behind a CDN or reverse proxy, the "source IP" your application sees is the proxy's. The real client address arrives in a header such as
X-Forwarded-For,Forwarded, or a provider-specific header. These headers are only trustworthy if your edge sets or overwrites them and your application ignores any value that arrives from outside. If you readX-Forwarded-Forfrom an unauthenticated request without that guarantee, anyone can spoof the "client IP" in your rate limiter and logs. -
One IP is not one person. Three common reasons:
- NAT: your home router shares one public IPv4 address among every device in the house.
-
Carrier-grade NAT (CGNAT): ISPs, especially mobile carriers, put many subscribers behind one public address. The shared address space
100.64.0.0/10(RFC 6598) exists for exactly this. If the WAN address shown in your router's admin page is in that range (or in a private range like10.0.0.0/8), your ISP is NAT-ing you and the public IP isn't "yours". -
IPv6 prefixes: a subscriber typically receives a whole prefix (commonly a
/56or/64), not a single address. Per-address reputation for IPv6 is meaningless, so systems usually aggregate at the prefix level.
IPv4 has only about 4.3 billion addresses, which is why NAT is everywhere and why the same address often serves very different people over a day or a year. Keep this in mind whenever somebody treats an IP as a stable identity.
3. From an IP to an organization: BGP, ASNs and RDAP
The first useful question you can ask about an IP is "who announces it?"
The internet is a network of networks. Each one is an Autonomous System (AS) with a number, an ASN, such as AS13335. ASes use BGP (RFC 4271) to announce which IP prefixes they can deliver traffic to. If you look up an address in the global routing table, you find the prefix that covers it and the origin AS that announces it.
Separately, IP address blocks are allocated and registered through five Regional Internet Registries: AFRINIC, APNIC, ARIN, LACNIC and RIPE NCC. The registry keeps a record: who holds the block, a country code, contact details, and so on. Modern registries expose this over RDAP (RFC 9082, RFC 9083), a JSON-over-HTTPS successor to the old whois protocol.
So there are two independent sources of truth:
| Question | Source | Tool |
|---|---|---|
| Who registered this block, and in which country? | RIR registry | RDAP / whois
|
| Who announces it on the internet right now? | BGP routing table | RIPEstat, bgp.tools, looking glasses |
Hands-on: 1.1.1.1
# Registry view (rdap.org redirects to the right registry; send a User-Agent)
curl -sL -A "Mozilla/5.0" https://rdap.org/ip/1.1.1.1
# Routing view (RIPEstat)
curl -s "https://stat.ripe.net/data/prefix-overview/data.json?resource=1.1.1.0/24"
The RDAP response is a big JSON document. The interesting fields, abbreviated:
{
"name": "APNIC-LABS",
"handle": "1.1.1.0 - 1.1.1.255",
"type": "ASSIGNED PORTABLE",
"startAddress": "1.1.1.0",
"endAddress": "1.1.1.255",
"country": "AU"
}
And the routing view (abbreviated) says the prefix is announced by:
{ "asn": 13335, "holder": "CLOUDFLARENET - Cloudflare, Inc." }
So 1.1.1.1 is registered to APNIC Labs, country AU, but announced by Cloudflare (AS13335), and, because it is anycast, the packets actually terminate at whichever Cloudflare location is closest to you on the network. Three different "locations" for one address, all of them correct answers to different questions. (Output captured on 2026-11-25; registry data changes over time.)

Figure 1: One address, three different answers: who holds it on paper, who announces it, and where packets actually land.
That distinction is the key to understanding most "wrong location" reports: a registry's country code is a statement about paperwork, not about where the machine is.
4. How geolocation databases guess a location
Commercial and free "IP geolocation" databases don't read GPS coordinates off your router. They build a model from multiple weak signals:
- Registry data (RDAP/whois records), including country and organization.
- Operator-published feeds. RFC 8805 defines a simple CSV format ("geofeed") that an ISP can publish to say which prefixes are in which country, region and city. Whether a given database consumes a given feed varies.
- Network measurements: round-trip times from probes at known locations, traceroute hints, and router hostnames that embed airport or city codes.
- Partner and user-contributed data, such as locations observed alongside logins, apps or Wi-Fi data. The details are vendor-specific and rarely documented.
- Routing and topology (which AS, which upstream, which internet exchange).
The output is a probabilistic answer. In practice:
- Country-level answers are usually reliable for ordinary consumer IPs, and noticeably less so for anycast, global backbones and corporate networks.
- City-level answers vary a lot. Mobile networks (traffic exits at a regional gateway, often far from the user), small ISPs and recently reassigned blocks are all prone to errors.
- Databases lag. When a block is reassigned or an ISP re-homes users, it can take days or weeks for the change to propagate across vendors, and different vendors update at different times. That's why two lookup sites can disagree about the same address.
If you build a geo-aware feature, design it so a wrong guess is cheap: let the user correct the region, never hard-block purely on a city-level lookup, and prefer signals the user controls (account country, billing address, an explicit language/region picker) over inferred ones.
5. How an IP gets labelled "residential", "mobile" or "datacenter"
Many services want to know not just where an address is but what kind of network it belongs to. This is the same pattern across vendors: combine several signals into a type label and sometimes a risk score.
Commonly used signals:
| Signal | What it tells you |
|---|---|
| ASN and organization name | An AS owned by a consumer ISP vs. a hosting company vs. a university. The single strongest signal. |
| Published cloud ranges | Major cloud providers publish their address ranges (for example, AWS ships a public ip-ranges.json), so classifying those as "datacenter" is trivial. |
| Reverse DNS (PTR) patterns | Hostnames such as 203-0-113-7.dyn.example-isp.net look like dynamic consumer pools, while vps-12345.compute.example.net looks like hosting. (Illustrative hostnames.)
|
| Prefix size and allocation type | A /24 assigned to a hosting company vs. a large block split across households. |
| Observed behavior | Abuse reports, blocklist listings, open-port scans (open proxies), and traffic patterns over time. |
| Network type hints | Carrier ASNs β "mobile"; university/government ASNs β "education"/"government". |
The usual output categories look like:
| Label | Typical meaning | Why it matters |
|---|---|---|
| ISP / residential | Consumer broadband | Treated as "ordinary users" by most systems |
| Mobile | Cellular carrier, usually CGNAT | Many users share one address; reputation is noisy |
| Hosting / datacenter | Cloud and VPS providers | Heavily used by automation, so often subject to stricter checks |
| Business | Corporate egress | Shared by many employees |
| Education / government | Campus and institutional networks | Large shared pools |

Figure 2: How several weak signals become a βtypeβ label, and why a label is a prior rather than a verdict.
Three honest caveats if you consume or build such data:
- It's a heuristic. The same IP can be labelled differently by different vendors, and a block can change type when it's resold or re-assigned.
- Shared addresses punish innocent users. CGNAT, offices, universities, hotels and coffee shops all concentrate many people behind one IP. Anything that treats "IP reputation" as a per-person verdict will have false positives.
- A label is a prior, not a decision. Sensible systems use it to decide how much additional verification to ask for (a challenge, a second factor, rate limits), not to make a final accept/reject call on its own.
If you run a service, this is also a design hint: don't make irreversible decisions on an IP-derived label alone, and give legitimate users on "bad neighborhoods" a path to prove they're fine.
6. Beyond the IP: consistency is what stands out
An IP is just one input. Browsers hand over many other values, and what often looks unusual is not any single value but inconsistency between them:
-
Intl.DateTimeFormat().resolvedOptions().timeZone(the browser's time zone) vs. the time zone of the IP's location. -
navigator.languagesvs. the country of the IP. - The set of IP addresses revealed through WebRTC vs. the address of the HTTP connection.
- The DNS resolver that handled your lookups vs. the network you appear to be on.
- Transport-level fingerprints (TLS and HTTP/2 characteristics) vs. the claimed
User-Agent.
Most users have some mismatch for innocent reasons: a traveler with a home-country browser language, a developer testing from a cloud VM, a remote worker on a corporate tunnel. That's why robust systems treat mismatches as weak evidence that raises the level of scrutiny, rather than a conviction.
For you as a developer, the takeaway is practical: when two environments behave differently, diff all these dimensions, not just the IP. The next two sections cover the two that people most often overlook.
7. WebRTC: the other way a browser can reveal an address
WebRTC lets browsers establish peer-to-peer media and data connections. To do that, each side needs to learn the addresses where it can be reached, a process called ICE (RFC 8445). The browser gathers candidates:
| Candidate type | Meaning |
|---|---|
host |
An address on a local interface (your LAN address) |
srflx |
"Server reflexive": your public address as seen by a STUN server (RFC 8489) |
relay |
An address allocated on a TURN relay |
The part that matters here is srflx: the browser sends a UDP packet to a STUN server, and the server answers with the source address it observed. That bypasses the HTTP layer completely, so it can differ from what a website sees for your regular page loads.

Figure 3: HTTP and WebRTC can take different paths, so the address a website sees and the address a STUN server sees may differ.
Two things reduce what is exposed:
- Most major browsers now hide local
hostaddresses behind mDNS names (random*.localhostnames) unless the page has been granted camera/microphone permission. This protects your LAN address, not your public one. - The public
srflxaddress is still discoverable by any page that creates aRTCPeerConnectionand points it at a STUN server. No permission prompt is required.
See it yourself
Paste this in your browser's developer console:
function gatherCandidates(timeoutMs = 4000) {
return new Promise((resolve) => {
const out = [];
const pc = new RTCPeerConnection({
iceServers: [{ urls: "stun:stun.l.google.com:19302" }],
});
const done = () => { pc.close(); resolve(out); };
pc.createDataChannel("probe");
pc.onicecandidate = (e) => {
if (!e.candidate) return;
// "candidate:<foundation> <component> <protocol> <priority> <address> <port> typ <type> ..."
const p = e.candidate.candidate.split(" ");
out.push({ type: p[7], protocol: p[2], address: p[4], port: p[5] });
};
pc.onicegatheringstatechange = () => {
if (pc.iceGatheringState === "complete") done();
};
pc.createOffer().then((o) => pc.setLocalDescription(o));
setTimeout(done, timeoutMs);
});
}
gatherCandidates().then(console.table);
You'll typically see one or more .local host candidates and one srflx row with your public address. Now compare that srflx address with what the HTTP side shows, for example by opening https://www.cloudflare.com/cdn-cgi/trace in a tab.
- Same address: your UDP and HTTP traffic leave through the same path. Expected for a plain connection or for a VPN that tunnels everything at the network layer.
- Different address: the two protocols take different routes. A frequent cause is an HTTP/SOCKS proxy configured in the browser (or a browser extension). Proxies carry the browser's TCP/HTTP requests, but WebRTC's UDP traffic can go out directly unless the browser is told otherwise.
If WebRTC exposing a different address is a problem for your use case, the knobs are browser-specific. Chrome has an enterprise policy, WebRtcIPHandling, with values such as default_public_interface_only and disable_non_proxied_udp; Firefox exposes preferences such as media.peerconnection.ice.default_address_only under about:config. Check the current documentation for your browser version, and be aware that disabling WebRTC entirely breaks video calls and some web apps.
8. DNS: who is resolving your names?
Before any HTTP request, the browser (or your OS) has to turn a hostname into an IP address, and the resolver that does it learns which names you look up. A "DNS leak" is the situation where lookups go to a resolver other than the one you intended, typically your ISP's, while your web traffic goes elsewhere.
Common reasons:
- A VPN or proxy that carries your TCP/UDP flows but leaves the system resolver configuration untouched.
- Split tunneling that routes only some apps or domains through the tunnel.
- Browsers using DNS over HTTPS (DoH, RFC 8484) to a provider of their choosing, independent of the OS resolver.
- IPv6 resolver addresses advertised by the router that the tunnel doesn't cover.

Figure 4: Three places your DNS queries can end up, and two commands that reveal which resolver actually reaches the internet.
Find out which resolver reaches the internet for you
Authoritative servers can report back the address of whoever queried them. A few well-known names do exactly that:
# Akamai: returns the address of the recursive resolver that asked
nslookup whoami.akamai.net
dig +short whoami.akamai.net
# Google: returns the resolver address, and (if the resolver sends it) the client-subnet hint
nslookup -type=TXT o-o.myaddr.l.google.com ns1.google.com
dig +short TXT o-o.myaddr.l.google.com @ns1.google.com
In my run of the Google query, the answer contained two TXT strings: one with the resolver's address, and a second beginning with edns0-client-subnet followed by a network prefix. That second line is EDNS Client Subnet (ECS, RFC 7871): some resolvers forward a truncated version of the client's network (for example, a /24) to authoritative servers so CDNs can pick a nearby edge. It's a feature with a privacy trade-off, and a good reminder that "which resolver" is not the only thing DNS reveals.
How to read the result:
- The address belongs to your ISP, and you expected a VPN or corporate resolver β queries are bypassing it.
- The address belongs to a public resolver such as Cloudflare or Google β not automatically a problem; it only matters if your threat model or policy says it should be a specific resolver.
- Results differ between the terminal and the browser β the browser is using its own DoH settings, or the two sit on different routes.
Be precise about what you're testing: a "leak" is relative to what you intended. There is nothing inherently wrong with using a public resolver, but it's worth knowing which one you're using.
9. "My terminal and my browser disagree"
A very common developer experience: the browser says you're in country A and curl says country B. Several unrelated mechanisms can cause this:
| Mechanism | Browser | CLI tools |
|---|---|---|
| OS-level / system proxy setting or PAC file | Usually honored | Often ignored |
HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY env vars |
Ignored | Honored by many tools (curl, Python urllib/requests, Go's default transport, β¦) |
| Network-level tunnel (TUN/VPN adapter) | Affected | Affected, since it sits below both |
| Per-app routing / split tunneling | Depends on the app | Depends on the app |
| Browser extensions that proxy traffic | Affected | Not affected |
| Containers / WSL2 / VMs | n/a | Often sit behind their own NAT, and whether they follow the host's VPN depends on the networking mode and the VPN client |
Notes worth remembering:
-
curlreads proxy environment variables and, on most platforms, does not use the OS-level proxy setting. Python'surllibadditionally reads system proxy settings on Windows and macOS. Node.js's built-infetchhas historically ignored proxy variables (newer releases added opt-in support), so check your runtime version. - A network-level tunnel affects everything on the machine; a proxy only affects programs that choose to use it.
- Tools that don't cooperate with your proxy can reveal your "real" route. That's useful for diagnosis, and it explains why a CI job and a browser session on the same machine can look like two different clients.

Figure 5: A browser, a terminal and a container on the same machine can leave through different routes.
A tiny script to compare paths
Cloudflare serves a plain-text diagnostic at /cdn-cgi/trace. It includes the address and country it sees, plus the data center that served you:
curl -s https://www.cloudflare.com/cdn-cgi/trace
Abbreviated output (values redacted):
ip=<your public IP>
visit_scheme=https
colo=LAX
http=http/1.1
loc=US
tls=TLSv1.3
warp=off
(PowerShell: irm https://www.cloudflare.com/cdn-cgi/trace.) colo is the three-letter code of the serving location, and loc is the country Cloudflare associates with the address. Here's a small Python script that prints the interesting parts, so you can run it from any environment (laptop, container, CI runner, remote shell) and compare:
#!/usr/bin/env python3
"""Print the public IP, country and edge location as Cloudflare sees them."""
import sys
import urllib.request
def trace(url="https://www.cloudflare.com/cdn-cgi/trace", timeout=10):
req = urllib.request.Request(url, headers={"User-Agent": "ip-diagnostics/1.0"})
with urllib.request.urlopen(req, timeout=timeout) as resp:
text = resp.read(4096).decode("utf-8", "replace")
return dict(line.split("=", 1) for line in text.splitlines() if "=" in line)
if __name__ == "__main__":
try:
info = trace()
except Exception as exc: # network errors, proxy errors, timeouts...
sys.exit(f"request failed: {exc}")
print(f"ip={info.get('ip')} loc={info.get('loc')} colo={info.get('colo')} warp={info.get('warp')}")
Run it in each place you care about, and compare with what your browser sees at the same URL. If the three outputs differ, you've located your routing difference without guessing.
Two flags that are easy to forget:
curl -4 -s https://www.cloudflare.com/cdn-cgi/trace # force IPv4
curl -6 -s https://www.cloudflare.com/cdn-cgi/trace # force IPv6
A tunnel that only handles IPv4 can leave IPv6 traffic on the direct path (an "IPv6 leak"). Checking both families is a cheap way to catch it.
10. A practical debugging checklist
When two environments disagree about "where you are" or "what you are":
-
Capture the HTTP view from each environment (
/cdn-cgi/traceor an IP echo service). Compareip,locandcolo. -
Force each address family (
curl -4/curl -6) and compare. Different results mean one of them isn't covered by your tunnel/proxy. - Identify the owner of the address with RDAP and the routing view (section 3). Is it an ISP, a hosting provider, a cloud?
-
Look at the reverse DNS (
nslookup <ip>/dig -x <ip>) for hints such as "dyn", "pool", "static", "cloud". -
Check WebRTC candidates in the browser (section 7) and compare the
srflxaddress with the HTTP-side address. - Check which DNS resolver is used by the terminal and by the browser (section 8). Look at the browser's DoH setting too.
-
Compare time zone and language:
Intl.DateTimeFormat().resolvedOptions().timeZoneandnavigator.languagesagainst the location of the IP. - Re-test after changes, and wait out caches. Geolocation databases and reputation lists lag, so a fix may not be visible everywhere immediately. Different vendors update at different speeds.
Write the result of each step next to the environment it came from. The pattern usually jumps out within five minutes.

Figure 6: The eight-step checklist as a one-page reference.
11. What none of this can tell you
It's worth being explicit about the limits of any browser-side checker, including the ones I mention below:
- You can't see a service's server-side decision. Whether a particular service accepts a sign-up, flags a login or restricts a feature depends on internal models, account history, payment details, device signals and policy that no external tool can observe. A "score" from a checker is an estimate built from public data.
- Terms of service and regional availability are the service's call. If a service isn't offered in a region, a clean-looking IP doesn't change that, and this article is about understanding and debugging network signals, not about getting around anyone's rules.
- Results are a snapshot. Your address, resolver and routes can change between sessions (DHCP leases, CGNAT re-assignment, tunnel reconnects).
- Databases disagree. When two sources conflict, treat both as hints and reason from first principles (registry, routing, reverse DNS) as in section 3.
12. Tools I use, and a disclosure
For quick checks, the tools in this post cover a lot with no dependencies: curl, nslookup/dig, the RDAP and RIPEstat APIs, and a browser console. For a one-page summary, there are also hosted lookups. A neutral one is the Cloudflare trace shown above; others are listed below.
Disclosure: I work on AnboVPN, and we run a few free, browser-based network tools that implement the checks described here, so I'm biased. If you'd like to try them, no sign-up is required:
- IP lookup (location, ASN, ISP, usage type, proxy/VPN/Tor flags): https://www.anbolink.com/tools/ip-lookup?utm_source=devto&utm_medium=social
- DNS leak test (which resolvers answer your lookups, with operator and country, and whether a non-public one sits outside your exit IPβs country): https://www.anbolink.com/tools/dns-leak?utm_source=devto&utm_medium=social
- Terminal one-liner that prints the same details as plain text:
curl https://www.anbolink.com/ip
Like any lookup, they combine third-party databases and make estimates, so the caveats in sections 4, 5 and 11 apply to them as well. If you find a case where a result is wrong, I'd genuinely like to hear about it.
Further reading
- RFC 4271, A Border Gateway Protocol 4 (BGP-4)
- RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space (
100.64.0.0/10) - RFC 7871, Client Subnet in DNS Queries (ECS)
- RFC 8445, Interactive Connectivity Establishment (ICE)
- RFC 8484, DNS Queries over HTTPS (DoH)
- RFC 8489, Session Traversal Utilities for NAT (STUN)
- RFC 8805, A Format for Self-Published IP Geolocation Feeds
- RFC 9082 and RFC 9083, Registration Data Access Protocol (RDAP): query format and JSON responses
- RIPEstat data API: https://stat.ripe.net/docs/data_api
Questions or corrections? Drop them in the comments. In particular: what's the strangest "my IP is in the wrong place" bug you've run into, and what turned out to be the cause?
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.