Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

The Short Answer

An IP address identifies a network interface on an IP network. Every packet carries a source and a destination address. Routers read the destination of each packet and forward it a step closer to the network that owns that address, and the answer travels back to the source address. Every device on the internet uses at least one, and so does every server.

IPv4 and IPv6

VersionExampleSize
IPv4203.0.113.1032 bits
IPv62001:db8::10128 bits

IPv4 writes four numbers from 0 to 255 separated by dots, which gives about 4.3 billion addresses, fewer than the devices that want one. IPv6 writes eight groups of hexadecimal digits separated by colons, and one run of zero groups can be shortened to ::. Many servers today have both. See IPv4 vs IPv6.

An address always belongs to a subnet, written with a prefix such as 203.0.113.10/24; see what is a subnet.

Public and Private Addresses

A public address is unique on the internet and can be reached from it, subject to firewalls. A private address, such as 192.168.1.20 or 10.0.0.5, is used inside a network and is repeated in countless homes and offices. A router with NAT lets devices with private addresses share one public address. Details are in public vs private IP.

Static and Dynamic Addresses

  • Static: set once and kept. Servers normally have static public addresses, because DNS records and clients point to them.
  • Dynamic: handed out for a period and possibly changed later, typically by DHCP. Home connections and mobile connections usually get dynamic addresses.

A dynamic address can be stable in practice when the DHCP server always gives the same address to the same device.

How a Server Gets Its Address

  • Static configuration: the address, prefix, gateway, and DNS servers are written into the network configuration, with Netplan on Ubuntu or NetworkManager on AlmaLinux and Rocky Linux; see how to configure a static IP with Netplan.
  • DHCP: the server asks for its settings at boot; see what is DHCP.
  • cloud-init: on many cloud images, cloud-init reads the network settings from the platform at first boot and writes the configuration; see what is cloud-init.

Which method a virtual server uses varies by provider. Before you change the network configuration by hand, open the console in your provider's control panel: a wrong address or gateway ends the SSH session.

Find a Server's IP Address on Linux

ip -br a

This lists each interface with its addresses. lo with 127.0.0.1 is the loopback interface, not a network address. ip a shows more detail, explained in the ip command guide. To print the addresses alone:

hostname -I

The public address the internet sees can differ from the interface address when the server sits behind NAT. To see it, ask an outside service that echoes the address back, for example:

curl -4 https://ifconfig.me
curl -6 https://ifconfig.me

IP Addresses and Domain Names

People use names; packets use addresses. DNS translates one into the other: an A record maps a name to an IPv4 address and an AAAA record to an IPv6 address. dig +short example.com shows the answer. The reverse direction, from address to name, is a PTR record. See what is DNS and what is reverse DNS.

One address can serve many websites, and one name can point to several addresses.

What an IP Address Reveals

  • The network that holds it: a whois lookup names the organization the address block is registered to.
  • A rough location: geolocation databases guess a country and often a region; the guess for a town is often wrong.
  • Not a person: an address does not carry a name or a street address. Only the network operator can link it to a subscriber.

Server logs record visitors' IP addresses, and some privacy laws can treat them as personal data. Check which rules apply to you, and keep logs only as long as you need them.

Was this answer helpful?
Loading...