📚 IP Address Basics 6 min de lectura

What's My IP: How IP Detection Works

Discover how websites detect your IP address, the role of HTTP headers, proxies, VPNs, and what your IP reveals about you.

How Websites See Your IP

Every time you connect to a website, your IP address is transmitted as part of the TCP connection. The web server reads the source IP from the incoming TCP packet. This is how "What's My IP" services work -- they simply echo back the IP address they see in the connection.

Your device (192.168.1.50)
  -> NAT router (203.0.113.10)
    -> Web server sees: 203.0.113.10

The server typically sees your public IP -- the address assigned to your router or gateway by your ISP. Your private LAN address (192.168.1.x) is never exposed to external servers.

HTTP Headers and IP Detection

Web servers can also look at HTTP headers for additional IP information:

Header Purpose
X-Forwarded-For Set by proxies; contains the original client IP
X-Real-IP Simplified version used by Nginx and other proxies
CF-Connecting-IP Cloudflare's header for the true client IP
Forwarded Standardized header (RFC 7239)

When you access a site through a CDN or reverse proxy, the server's direct connection is to the proxy, not to you. The proxy adds these headers so the application knows your real IP.

How Proxies and VPNs Change Detection

  • HTTP proxy -- The proxy's IP is visible to the server. Your real IP may still appear in X-Forwarded-For unless the proxy strips it.
  • SOCKS proxy -- Similar to HTTP proxies but work at a lower level. The proxy IP is what the server sees.
  • VPN -- Your traffic exits from the VPN server's IP. No HTTP headers reveal your real IP because the VPN operates at the network layer.
  • Tor -- Traffic exits from a Tor exit node. Your IP is hidden behind three layers of relays.

What Your IP Reveals

An IP address can be used to determine:

  • Approximate location -- City-level geolocation is typically accurate to within 25-50 km. Country-level is very reliable.
  • ISP / organization -- WHOIS data shows which provider owns the address block.
  • Connection type -- Whether you are on residential, business, mobile, or hosting infrastructure.
  • Blacklist status -- Whether your IP has been flagged for spam, abuse, or malicious activity.

Protecting Your IP Address

If you want to prevent websites from seeing your real IP:

  • Use a VPN to mask your IP with the VPN server's address.
  • Use Tor Browser for maximum anonymity (at the cost of speed).
  • Be aware of WebRTC leaks that can expose your real IP even behind a VPN -- disable WebRTC in your browser settings or use a browser extension.

Ver también