Every device on the internet needs an address. As a developer, understanding IP addresses is fundamental to debugging connectivity issues, configuring servers, and understanding how your applications talk to the world. Whether it's configuring localhost or setting up a VPC, IP concepts are everywhere.
An Internet Protocol (IP) address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. It serves two main functions:
Think of it like a postal address. To send a letter (data packet), you need to know where the recipient lives (their IP address).
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address Length | 32-bit | 128-bit |
| Address Space | ~4.3 billion | ~340 undecillion (virtually infinite) |
| Format | Dotted Decimal (192.168.1.1) | Hexadecimal (2001:0db8::1) |
| Configuration | Manual or DHCP | SLAAC (Stateless Auto-configuration) |
Originally, IP addresses were divided into classes (A, B, C, D, E). While modern routing uses CIDR (Classless Inter-Domain Routing), understanding these classes helps explain the "Private IP" ranges defined in RFC 1918.
You'll see these addresses constantly in development environments. They are safe to use internally because they don't conflict with public internet addresses.
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
The entire 127.0.0.0/8 block is reserved for loopback. This means any traffic sent to an address starting with 127 is routed back to the host machine, never leaving the network interface. localhost is simply a hostname that resolves to 127.0.0.1 (IPv4) or ::1 (IPv6).
In a server configuration (like Express.js or Python Flask), binding to 0.0.0.0 means "listen on all available network interfaces".
127.0.0.1, only devices on that specific computer can access it.0.0.0.0, other devices on your local network (like your phone or a coworker's laptop) can access it via your LAN IP (e.g., 192.168.1.5:3000).If you see an IP starting with 169.254, it usually means your computer tried to get an IP from a DHCP server (like your router) but failed. It assigned itself a Link-Local address.
A subnet mask defines which part of an IP address refers to the network and which part refers to the host (device). CIDR (Classless Inter-Domain Routing) is a shorthand for this.
Most developers never see their public IP directly. Your router performs NAT (Network Address Translation), which allows many private devices to share a single public IP on the internet.
IPv6 is increasingly common. Modern OSes often prefer IPv6 over IPv4 when both are available.
::1 (equivalent to 127.0.0.1)2001:0db8::1 compresses repeating zeros.0.0.0.0 and :: where supported.
When testing on a phone or another device, you must use your machine's LAN IP (e.g., 192.168.1.5), not localhost.
ipconfig (Windows) or ip addr (Linux) to find your LAN IP quickly.
0.0.0.0 for LAN access, not just 127.0.0.1.Every developer should know these commands to diagnose IP issues.
localhost on your phone refers to the phone itself! To access your computer's server, make sure your server listens on 0.0.0.0 (not just 127.0.0.1) and access it using your computer's LAN IP (e.g., 192.168.1.5:3000).