← All Articles

How to Find Someone's IP Address (Legal Methods)

There are many legitimate reasons you might need to find someone's IP address — from tracking down unauthorized access to your server, to investigating suspicious emails, to troubleshooting network connections. This guide covers the legal methods available and the important ethical and legal boundaries you should be aware of.

Important Legal and Ethical Notice

Before proceeding, understand that:

  • An IP address is considered personal data in many jurisdictions (including the EU under GDPR)
  • Using someone's IP address to harass, stalk, or attack them is illegal
  • The methods described here are for legitimate purposes such as security, server administration, and authorized investigations
  • If you are a victim of cybercrime, contact law enforcement — they have legal tools to trace IP addresses that civilians do not. See our guide on how police track IP addresses

Method 1: Check Email Headers

Email headers contain routing information that can include the sender's IP address. This works most reliably with emails sent from personal email servers or older email clients. Major providers like Gmail and Outlook typically strip the sender's IP from headers for privacy.

Gmail

  1. Open the email
  2. Click the three dots menu and select "Show original"
  3. Look for the Received: headers — the sender's IP may appear in the earliest (bottom) Received line
  4. Copy any IP addresses you find and look them up using our IP Lookup tool

Outlook

  1. Open the email
  2. Click File then Properties
  3. The headers appear in the "Internet headers" box
  4. Search for Received: lines

Limitations

Most modern email providers (Gmail, Outlook, Yahoo) replace the sender's IP with their own server IP for privacy. You will see Google's or Microsoft's IP addresses, not the sender's actual IP. This method works best with:

  • Emails sent from self-hosted email servers
  • Emails from older or less common email providers
  • Corporate email systems that do not strip headers

Method 2: Server Access Logs

If you own or administer a website or server, every visitor's IP address is recorded in your server logs. This is the most reliable method for finding the IP of someone who has interacted with your web property.

Apache Logs

# View recent access logs
tail -100 /var/log/apache2/access.log

# Search for a specific page
grep "/admin" /var/log/apache2/access.log

Nginx Logs

# View recent access logs
tail -100 /var/log/nginx/access.log

# Search for specific IPs
grep "suspicious-page" /var/log/nginx/access.log

Once you have an IP address from your logs, use our IP Lookup tool to determine the visitor's location, ISP, and organization. For more detailed ownership information, try the WHOIS lookup.

Method 3: Direct Network Connections

Some applications create direct peer-to-peer connections, which reveal IP addresses to both parties:

  • Online gaming — Some multiplayer games use peer-to-peer connections
  • Voice/video calls — Some VoIP applications connect directly between users
  • Torrenting — BitTorrent connections expose IPs to all peers in a swarm
  • Direct file sharing — P2P file sharing applications

On Windows, you can see active connections using:

netstat -an

On Mac/Linux:

netstat -an | grep ESTABLISHED

Method 4: Your Own Network (Router Admin)

If you manage a network, your router logs all connected devices and their IP addresses:

  1. Access your router's admin panel (usually 192.168.1.1 or 192.168.0.1)
  2. Look for "Connected Devices," "DHCP Client List," or "Network Map"
  3. Each device shows its private IP and MAC address

Note that these are private (local) IP addresses. To find your network's public IP, visit WheresThatIP.com.

Method 5: Using DNS Records

If someone runs a website or email server, you can find the server's IP address through DNS records:

# Find a website's IP
nslookup example.com

# Find mail server IP
nslookup -type=MX example.com

Our DNS Lookup tool provides a user-friendly way to query these records without using the command line.

What You Can Learn From an IP Address

Once you have an IP address, you can determine:

  • Approximate location — City and region (not a precise address)
  • ISP — The internet provider
  • Organization — If it belongs to a company or institution
  • Connection type — Residential, business, mobile, or VPN/proxy
  • Network information — ASN, IP range, and registration details

Use our IP Lookup tool to get all of this information instantly. For deeper analysis, the WHOIS tool reveals registration and ownership details.

What You Cannot Do With Someone's IP

It is important to understand the limitations. An IP address does not reveal:

  • The person's exact street address
  • Their name, phone number, or email
  • What they are doing online
  • The contents of their communications

For a full breakdown, read our guide on what someone can do with your IP address.

Protecting Your Own IP Address

If you are concerned about others finding your IP, you can protect yourself by:

  • Using a VPN service to mask your real IP
  • Avoiding peer-to-peer connections when privacy matters
  • Using privacy-focused email providers
  • Being cautious about clicking links from unknown sources

Learn more in our guides on how to hide your IP address and IP address scams to avoid.