IP Lookup Tool Guide

2026-04-28·5 min read·Inquiry

IP Address Basics

An IP address (Internet Protocol Address) is a unique identifier for devices on the internet, used for network location and communication. There are currently two versions: IPv4 (32-bit, e.g., 192.168.1.1) and IPv6 (128-bit, e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). IP lookup tools can obtain information about an IP address's geographic location, ISP information, and whether it is a proxy/VPN.

IP address lookup use cases include: network troubleshooting (confirming local public IP), security audits (tracking suspicious IPs), content geographic restriction checks, and load balancing configuration verification. Note that IP geographic location information is estimated based on IP registration data, typically accurate to city level, and cannot precisely locate specific addresses.

Lookup Methods and Tools

# Command-line lookup methods

# View local IP address
# Windows
ipconfig

# macOS/Linux
ifconfig
ip addr

# Query public IP
curl ifconfig.me
curl icanhazip.com

# DNS lookup
nslookup example.com
dig example.com
dig example.com MX    # Query mail server

# Whois lookup
whois example.com

# Traceroute (trace route)
tracert example.com    # Windows
traceroute example.com # macOS/Linux

Programming IP Lookup

// JavaScript get public IP and geolocation
async function getIPInfo() {
  // Get public IP
  const ipResponse = await fetch('https://api.ipify.org?format=json');
  const { ip } = await ipResponse.json();

  // Get geolocation information
  const geoResponse = await fetch(`https://ipapi.co/${ip}/json/`);
  const geoData = await geoResponse.json();

  return {
    ip: geoData.ip,
    city: geoData.city,
    region: geoData.region,
    country: geoData.country_name,
    ISP: geoData.org,
    timezone: geoData.timezone,
    latitude: geoData.latitude,
    longitude: geoData.longitude
  };
}

// Python using requests library
// import requests
// def get_ip_info():
//     ip = requests.get('https://api.ipify.org').text
//     response = requests.get(f'https://ipapi.co/{ip}/json/')
//     return response.json()

Recommended Tools

whatismyipaddress.com is an online IP lookup tool. ipinfo.io provides IP information API services. MaxMind provides high-precision IP geolocation databases. nslookup and dig are command-line DNS lookup tools.