Web & Networking › Networking Fundamentals
IP Address
A numeric address identifying a device on a network.
Also known as: IP, internet protocol address, IPv4 address, IPv6 address
An IP address is a number that identifies a device on a network, so other devices know where to send data. It works like a postal address for packets.
Two versions are in use:
| Looks like | Notes | |
|---|---|---|
| IPv4 | 192.168.1.20 | Four numbers from 0 to 255. About 4.3 billion possible addresses |
| IPv6 | 2001:db8::1 | Eight groups of hex digits (zeros can be shortened with ::). Vastly more addresses |
See IPv4 vs IPv6.
Public vs private
- A public address is reachable across the internet. Your servers have these.
- A private address only works inside a local network. IPv4 reserves ranges such as
10.x.x.x,172.16.x.x-172.31.x.xand192.168.x.xfor this. Your laptop at home likely has one (see private IPs). 127.0.0.1is localhost: this very machine, used for connecting to services you run locally (localhost).
Many devices can share one public address via NAT, which is why your home address list isn’t your computer’s internet identity.
What it means for developers
- You usually reach services by name; DNS finds the IP.
- An address alone isn’t enough to reach a program. You also need a port:
192.168.1.20:5432. 0.0.0.0in a server’s settings means “listen on all network interfaces”, while127.0.0.1means “only this machine”. A server that works locally but not from another device often listens on the wrong one.- Don’t hard-code IP addresses; they change. Don’t treat an IP as proof of identity either, since it can be shared or spoofed.
Check yours with ip addr (Linux), ifconfig or ipconfig.