IP Addresses Explained: IPv4, IPv6, and How They Work

· 12 min read

Table of Contents

What Is an IP Address?

Every device connected to the internet needs a unique identifier—an Internet Protocol (IP) address. Think of it as a postal address for your computer, smartphone, or server. Without IP addresses, data packets would have no way to find their destination, and the internet as we know it simply wouldn't function.

An IP address serves two fundamental purposes: host identification and location addressing. When you type a website URL into your browser, your device uses IP addresses behind the scenes to locate the server hosting that website and establish a connection. This process happens in milliseconds, millions of times per second across the global internet.

There are currently two versions of IP addresses in active use: IPv4 and IPv6. Understanding both is essential for anyone working with networks, servers, or web infrastructure. Each version has distinct characteristics, addressing schemes, and use cases that make them suitable for different networking scenarios.

IP addresses work at Layer 3 (the Network Layer) of the OSI model, providing the logical addressing necessary for routing data across interconnected networks. Unlike MAC addresses, which are physically burned into network hardware, IP addresses can be dynamically assigned and changed as needed.

IPv4: The Original Standard

IPv4 (Internet Protocol version 4) has been the backbone of internet communication since its deployment in 1983. An IPv4 address consists of four groups of numbers separated by dots, where each group (called an octet) ranges from 0 to 255.

# IPv4 address format
192.168.1.100

# Each octet is 8 bits (1 byte)
# Total: 32 bits = 4,294,967,296 possible addresses

# Finding your public IP
curl ifconfig.me

# Finding your local IP (Linux/Mac)
ifconfig | grep "inet " | grep -v 127.0.0.1

# Windows command
ipconfig | findstr IPv4

The 32-bit structure of IPv4 allows for approximately 4.3 billion unique addresses. While that seemed like plenty in the early days of the internet, the explosive growth of connected devices—smartphones, IoT devices, smart home appliances—has exhausted this address space. The last blocks of IPv4 addresses were officially allocated in 2011, though various conservation techniques have extended their usability.

IPv4 addresses are typically written in dotted-decimal notation, making them human-readable. Each octet represents 8 bits, and when converted to binary, you can see the full 32-bit structure:

Decimal:  192.168.1.100
Binary:   11000000.10101000.00000001.01100100

Pro tip: Use our IP Lookup Tool to instantly check your current public IP address and get detailed geolocation information about any IP address worldwide.

Despite the address exhaustion problem, IPv4 remains the dominant protocol on the internet. Technologies like Network Address Translation (NAT) and Classless Inter-Domain Routing (CIDR) have helped extend the life of IPv4 by allowing multiple devices to share a single public IP address.

IPv6: The Next Generation

IPv6 (Internet Protocol version 6) was developed to solve the IPv4 address exhaustion problem. Introduced in 1998, IPv6 uses 128-bit addresses, providing an almost incomprehensibly large address space—approximately 340 undecillion (3.4 × 10³⁸) unique addresses.

# IPv6 address format
2001:0db8:85a3:0000:0000:8a2e:0370:7334

# Shortened format (removing leading zeros)
2001:db8:85a3:0:0:8a2e:370:7334

# Further shortened (consecutive zero groups as ::)
2001:db8:85a3::8a2e:370:7334

# Finding your IPv6 address (Linux/Mac)
ifconfig | grep inet6

# Windows command
ipconfig | findstr IPv6

IPv6 addresses are written in hexadecimal notation, divided into eight groups of four hexadecimal digits separated by colons. This format is more complex than IPv4 but provides several advantages beyond just more addresses.

Key improvements in IPv6:

Despite these advantages, IPv6 adoption has been slower than anticipated. As of 2026, approximately 45% of internet traffic uses IPv6, with significant regional variations. Google reports that countries like India, Malaysia, and Germany have adoption rates exceeding 60%, while others lag behind.

Feature IPv4 IPv6
Address Length 32 bits 128 bits
Address Format Dotted decimal (192.168.1.1) Hexadecimal (2001:db8::1)
Total Addresses ~4.3 billion ~340 undecillion
Header Size 20-60 bytes (variable) 40 bytes (fixed)
IPsec Support Optional Mandatory
Fragmentation Routers and hosts Hosts only
Checksum Included in header Not included

Public vs Private IP Addresses

Not all IP addresses are created equal. The distinction between public and private IP addresses is fundamental to understanding how modern networks operate.

Public IP addresses are globally unique and routable on the internet. Your Internet Service Provider (ISP) assigns your home or business a public IP address that identifies your network to the outside world. These addresses are managed by regional internet registries and must be unique across the entire internet.

Private IP addresses are used within local networks and are not routable on the public internet. These addresses can be reused across different private networks without conflict. The Internet Assigned Numbers Authority (IANA) has reserved specific ranges for private use:

Class Private IP Range CIDR Notation Number of Addresses
Class A 10.0.0.0 - 10.255.255.255 10.0.0.0/8 16,777,216
Class B 172.16.0.0 - 172.31.255.255 172.16.0.0/12 1,048,576
Class C 192.168.0.0 - 192.168.255.255 192.168.0.0/16 65,536

When you check your device's IP address on a home network, you'll typically see something like 192.168.1.100—a private address. However, when you visit a website like our IP lookup tool, you'll see your public IP address, which is shared by all devices on your network.

This dual-address system is made possible by Network Address Translation (NAT), which we'll explore in detail later. The key takeaway is that private addresses allow organizations to build large internal networks without consuming scarce public IP addresses.

Quick tip: If you're troubleshooting network connectivity, always distinguish between your private (local) IP and public IP. Connection issues to external services relate to your public IP, while problems accessing local devices involve private IPs.

Understanding IP Address Classes and Subnetting

Originally, IPv4 addresses were divided into five classes (A through E) based on the first few bits of the address. While classful networking is largely obsolete, replaced by Classless Inter-Domain Routing (CIDR), understanding these classes helps grasp fundamental networking concepts.

IPv4 Address Classes:

Subnetting is the practice of dividing a network into smaller sub-networks. This improves network performance, enhances security, and makes more efficient use of IP address space. A subnet mask determines which portion of an IP address represents the network and which represents the host.

# Common subnet masks
255.255.255.0   = /24 (254 usable hosts)
255.255.255.128 = /25 (126 usable hosts)
255.255.255.192 = /26 (62 usable hosts)
255.255.255.224 = /27 (30 usable hosts)

# Example: Dividing 192.168.1.0/24 into 4 subnets
Subnet 1: 192.168.1.0/26   (192.168.1.1 - 192.168.1.62)
Subnet 2: 192.168.1.64/26  (192.168.1.65 - 192.168.1.126)
Subnet 3: 192.168.1.128/26 (192.168.1.129 - 192.168.1.190)
Subnet 4: 192.168.1.192/26 (192.168.1.193 - 192.168.1.254)

CIDR notation (the "/24" suffix) indicates how many bits are used for the network portion. A /24 network uses 24 bits for the network, leaving 8 bits for hosts (2⁸ - 2 = 254 usable addresses, subtracting the network and broadcast addresses).

How IP Address Lookup Works

IP address lookup is the process of determining information about an IP address, including its geographic location, ISP, organization, and other metadata. This process relies on databases maintained by regional internet registries and third-party services.

When you use an IP lookup tool, several things happen behind the scenes:

  1. Database Query: The tool queries one or more IP geolocation databases (like MaxMind, IP2Location, or IPinfo) that map IP address ranges to geographic locations and organizations.
  2. WHOIS Lookup: For detailed ownership information, the tool may perform a WHOIS query against the appropriate regional internet registry (ARIN, RIPE, APNIC, LACNIC, or AFRINIC).
  3. Reverse DNS: The tool may perform a reverse DNS lookup to find the hostname associated with the IP address.
  4. ASN Information: Autonomous System Number data reveals which organization controls the routing for that IP address.

The accuracy of IP geolocation varies significantly. While country-level accuracy typically exceeds 95%, city-level accuracy ranges from 50-80% depending on the database and region. Factors affecting accuracy include:

Pro tip: For accurate geolocation of your own users, consider using HTML5 Geolocation API in combination with IP geolocation. The browser-based API provides much more precise location data when users grant permission.

IP lookup tools are invaluable for various use cases:

IP Addresses and DNS: The Internet's Phone Book

The Domain Name System (DNS) is the bridge between human-readable domain names and machine-readable IP addresses. When you type "example.com" into your browser, DNS translates that name into an IP address like 93.184.216.34 so your computer can establish a connection.

The DNS resolution process involves multiple steps:

  1. Browser cache check: Your browser first checks if it has recently resolved this domain
  2. Operating system cache: If not in browser cache, the OS checks its DNS cache
  3. Recursive resolver: Your ISP's DNS server (or a public DNS like Google's 8.8.8.8) receives the query
  4. Root nameserver: The recursive resolver queries a root nameserver for the TLD nameserver
  5. TLD nameserver: The .com nameserver provides the authoritative nameserver for the domain
  6. Authoritative nameserver: Finally, the domain's nameserver returns the IP address
  7. Response cached: The IP address is cached at multiple levels for future requests
# Performing DNS lookups from command line

# Basic DNS lookup (A record)
nslookup example.com

# Detailed DNS information
dig example.com

# Reverse DNS lookup (IP to hostname)
nslookup 93.184.216.34
dig -x 93.184.216.34

# Query specific DNS record types
dig example.com MX    # Mail servers
dig example.com TXT   # Text records
dig example.com AAAA  # IPv6 address

DNS records come in various types, each serving a specific purpose:

DNS caching significantly improves internet performance by reducing the need for repeated lookups. However, it also means that DNS changes can take time to propagate globally—a phenomenon known as DNS propagation, which typically takes 24-48 hours but can be longer.

Use our DNS Lookup Tool to query DNS records for any domain and troubleshoot DNS-related issues quickly.

Network Address Translation (NAT)

Network Address Translation (NAT) is the technology that allows multiple devices on a private network to share a single public IP address. Without NAT, the IPv4 address exhaustion problem would have been catastrophic years ago.

NAT operates at the network gateway (typically your router) and performs address translation in both directions:

Outbound traffic: When a device on your private network (e.g., 192.168.1.100) sends data to the internet, the NAT router replaces the private source IP with its public IP address and tracks the connection in a translation table.

Inbound traffic: When response packets arrive at the public IP, the router consults its translation table to determine which private IP address should receive the data and forwards it accordingly.

# Example NAT translation table
Private IP:Port    →  Public IP:Port     →  Destination
192.168.1.100:5432 →  203.0.113.5:12345  →  93.184.216.34:80
192.168.1.101:6789 →  203.0.113.5:12346  →  172.217.14.206:443
192.168.1.102:8901 →  203.0.113.5:12347  →  151.101.1.140:80

There are several types of NAT:

While NAT has been essential for IPv4 conservation, it introduces some complications:

Quick tip: If you're hosting a server or service behind NAT, you'll need to configure port forwarding on your router to allow inbound connections. Each service requires its specific port to be forwarded to the correct internal IP address.

Security and Privacy Considerations

Your IP address reveals more information than you might think. While it doesn't directly identify you as an individual, it can be used to approximate your location, identify your ISP, and track your online activities across websites.

Privacy concerns with IP addresses:

Security best practices:

For businesses and server administrators, additional security measures are critical:

Check your current IP address and see what information is publicly visible using our IP Lookup Tool. Understanding what data is exposed helps you make informed decisions about privacy protection.

Troubleshooting IP Address Issues

IP address problems are among the most common network issues. Understanding how to diagnose and resolve them is essential for maintaining connectivity.

Common IP address problems:

Diagnostic commands for troubleshooting:

# Check current IP configuration
# Windows
ipconfig /all

# Linux/Mac
ifconfig -a
ip addr show

# Release and renew DHCP lease
# Windows
ipconfig /release
ipconfig /renew

# Linux
sudo dhclient -r
sudo dhclient

# Test connectivity to gateway
ping 192.168.1.1

# Test connectivity to external IP
ping 8.8.8.8

# Test DNS resolution
nslookup google.com

# Trace route to destination
# Windows
tracert google.com

# Linux/Mac
traceroute google.com

# Display routing table
# Windows
route print

# Linux/Mac
netstat -rn
ip route show

Step-by-step troubleshooting process:

  1. Verify physical connection: Check cables, WiFi connection, and network adapter status
  2. Check IP configuration: Ensure you have a valid IP address (not 169.254.x.x, which indicates DHCP failure)
  3. Test local connectivity: Ping your gateway to verify local network communication
  4. Test external connectivity: Ping a public IP address like 8.8.8.8 to check internet access
  5. Test DNS resolution: Use nslookup to verify DNS is working correctly
  6. Check firewall rules: Ensure firewall isn't blocking necessary traffic
  7. Review DHCP server: Verify DHCP server is running and has available addresses

Pro tip: If you see an IP address starting with 169.254, your device failed to get an address from DHCP and assigned itself an APIPA (Automatic Private IP Addressing) address. This indicates a DHCP server problem or network connectivity issue.

For persistent issues, consider these advanced troubleshooting steps:

Frequently Asked Questions

What's the difference between a static and dynamic IP address?

Related Tools

🔧 IP Lookup 🔧 DNS Lookup 🔧 WHOIS Lookup 🔧 Port Scanner
We use cookies for analytics. By continuing, you agree to our Privacy Policy.