Gate46
  1. Learn
  2. What is an IP address?

What is an IP address?

The number that lets the internet deliver data to your connection: what it is, who hands it out, what it says about you, and how to find yours on any device.

An address for every connection

An IP address is the number a network uses to deliver data to the right device, the way a postal address gets a letter to the right building. IP stands for Internet Protocol, the set of rules every device on the internet follows to send and receive data.

Data crosses the internet in small pieces called packets. Each packet carries two addresses: where it is going and where it came from. Routers along the way read the destination and pass the packet one step closer. The reply uses the source address to find its way back.

Two versions are in use. An IPv4 address is 32 bits long and is written as four numbers from 0 to 255, such as 203.0.113.42. An IPv6 address is 128 bits long and is written in hexadecimal, such as 2001:db8:4f2a:9c00::1b. Many connections have one of each. IPv4 vs IPv6 explains why there are two.

Public and private addresses

A home or office network uses two kinds of address. The public address is the one your provider gives your router. It is unique on the whole internet, and it is what every website sees. Yours is at the top of the My IP page.

Devices behind the router use private addresses from ranges set aside for local networks. Anyone may use these ranges, so millions of homes use the same ones, and routers on the public internet refuse to carry them. The first three rows below are the private ranges. The other three are special ranges you may also see in device settings or router status pages.

RangeCoversWhere you meet it
10.0.0.0/810.0.0.0 to 10.255.255.255Private. Offices and some home routers.
172.16.0.0/12172.16.0.0 to 172.31.255.255Private. Offices and virtual networks.
192.168.0.0/16192.168.0.0 to 192.168.255.255Private. Most home routers.
100.64.0.0/10100.64.0.0 to 100.127.255.255Shared space for carrier-grade NAT inside provider networks.
169.254.0.0/16169.254.0.0 to 169.254.255.255Link-local. A device gives itself one when no DHCP server answers.
127.0.0.0/8127.0.0.0 to 127.255.255.255Loopback. The device talking to itself.

IPv6 has its own equivalents: fe80::/10 for link-local addresses, which every IPv6 interface has, and fc00::/7 for private networks. The number after the slash is the prefix length. The subnet calculator shows the exact range for any prefix.

The router joins the two worlds with network address translation, or NAT. When a device sends a packet out, the router replaces the private source address with its own public one, notes the connection in a table, and reverses the swap when the reply arrives. One public address can serve every device in the building.

The side effect is that connections can only start from the inside. A packet that arrives unasked matches nothing in the table and is dropped. To host a game server or reach a camera from outside, you add a port forwarding rule and then confirm it with the port checker. Some providers run a second layer of NAT in their own network, called carrier-grade NAT. Your router's outside address is then usually in 100.64.0.0/10, and port forwarding cannot work until the provider gives you a public address.

Dynamic and static addresses

Most home connections have a dynamic address. The provider lends it to your router for a set time and may hand out a different one after a restart, an outage or maintenance. Some providers renew the same address for months. Others change it every day.

A static address never changes. Businesses pay for one when they run their own mail or web server, or when a partner's firewall only admits known addresses. If all you need is to reach your home network by name, a dynamic DNS service that updates a hostname whenever the address changes does the job for less.

The same split exists inside your network. The router hands out private addresses with DHCP, and they can change. Reserve an address in the router's DHCP settings for anything that needs to stay put, such as a printer or a device with a port forwarding rule.

Who hands out addresses

Providers do not invent addresses. Blocks are allocated from the top down so that no two networks receive the same one.

  • IANA, the Internet Assigned Numbers Authority, holds the global pool and allocates large blocks to the regional registries.
  • Five regional internet registries allocate to providers and large organisations: ARIN (United States, Canada and parts of the Caribbean), RIPE NCC (Europe, the Middle East and parts of Central Asia), APNIC (Asia and the Pacific), LACNIC (Latin America and parts of the Caribbean) and AFRINIC (Africa).
  • Providers, meaning broadband, mobile and hosting companies, assign addresses from their blocks to customers.

Every allocation is on public record. WHOIS shows which organisation holds a block, and IP lookup shows the provider and the network number (ASN) behind any address.

What an address reveals, and what it does not

Every site and service you connect to sees your public address. From it, anyone can look up:

  • The provider and network the address belongs to.
  • An approximate location, usually the city or region where the provider routes its traffic. That can be a long way from where you are.
  • The kind of network: home broadband, mobile, or a data centre, because blocks are registered publicly.
  • A hostname, if the provider set one. Reverse DNS shows it.

It does not reveal your name, your street address or what you do online. An address identifies a connection, not a person, and behind NAT one address is shared by everyone on the network. Only the provider can match an address and a time to a customer account, and in most countries it releases that only in response to a legal order.

How to find your addresses

For the public address, open My IP. Every device on the same network shows the same public IPv4 address. The local address is in each device's network settings:

  • Windows. Settings > Network & internet > Wi-Fi or Ethernet, then open the connection's properties and read the IPv4 address line. Or open Command Prompt and run ipconfig.
  • macOS. System Settings > Network > Wi-Fi > Details > TCP/IP. In Terminal, ipconfig getifaddr en0 prints the Wi-Fi address on most Macs, and ifconfig lists every interface.
  • Linux. Run ip addr and read the inet line for IPv4 and the inet6 lines for IPv6. Older systems use ifconfig.
  • iPhone and iPad. Settings > Wi-Fi, then tap the info button next to the connected network.
  • Android. Settings > Network & internet > Internet, then tap the connected Wi-Fi network. Menu names vary by manufacturer. On Samsung phones it is Settings > Connections > Wi-Fi, then the gear icon.

A local address that starts with 192.168, 10, or 172.16 to 172.31 means you are behind NAT, which is normal.

How to change it

  • Restart the router. Leave it off for a few minutes. This only helps with a dynamic address, and some providers hand the same one straight back.
  • Switch networks. Mobile data, office Wi-Fi and home broadband each have their own public address.
  • Use a VPN or proxy. Sites then see the VPN server's address instead of yours.
  • Ask the provider. They can assign a static address, or move you off carrier-grade NAT, sometimes for a fee.

To change a device's local address, edit the reservation in the router's DHCP settings or set the address by hand in the device's network settings. After any change, reload My IP to confirm what the internet now sees.

Common questions

Can two devices have the same IP address?

Private addresses repeat everywhere: millions of home networks contain a 192.168.1.1. Inside one network each address must be unique, and a duplicate causes an address conflict that can knock one or both devices offline. A public IPv4 address is normally shared by every device behind the same router.

Does my IP address follow me when I travel?

No. The address belongs to the network you are connected to, not to your phone or laptop. At a hotel you use the hotel's address, and on mobile data you use your carrier's.

Can someone find my home from my IP address?

Not from the address alone. Location databases place an address in a city or region, and often the wrong one. Try your own address in IP lookup to see how close it gets. Only your provider knows which customer had an address at a given time.

What are 127.0.0.1 and localhost?

They are the loopback address and its name. Traffic sent there never leaves your device, which is how developers test a server running on their own machine. The IPv6 equivalent is ::1.