What Is an IP Address?
An IP address (Internet Protocol address) is a unique numeric label assigned to every device or server connected to a network. It lets data find the right destination. IPv4 addresses look like 192.0.2.10 and IPv6 addresses look like 2001:db8::1.
IPv4 and IPv6
| IPv4 | IPv6 | |
|---|---|---|
| Length | 32 bits | 128 bits |
| Format | Four numbers 0 to 255 separated by dots | Eight groups of hexadecimal numbers separated by colons |
| Example | 192.0.2.10 | 2001:db8::1 |
| Number of addresses | About 4.3 billion | About 3.4 x 10^38 |
IPv4 addresses are nearly exhausted, so IPv6 was created to provide practically unlimited addresses. Both versions run side by side today, and most hosting providers support both.
Public and private IP addresses
A public IP address is reachable from the internet, like your web server's. A private address is used inside a local network and is not routed on the internet. The private IPv4 ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Your home router uses network address translation (NAT) so many private devices share one public address.
Static vs. dynamic IP addresses
A static IP address never changes, which is what a hosting server needs so that DNS records always point to the right place. A dynamic address is assigned by DHCP and can change when a device reconnects, as with most home internet connections.
IP addresses in web hosting
- Shared IP: many sites on a shared hosting server use the same IP address, and the web server tells them apart by the domain name in the request.
- Dedicated IP: an address used by one account, useful for certain SSL setups, email reputation and direct access by IP.
- DNS: an A record maps a domain to an IPv4 address and an AAAA record maps it to an IPv6 address.
- Reputation: if a neighbor on a shared IP sends spam, the address can end up on a blocklist that affects everyone using it.
How to find an IP address
# IP address of a domain
dig +short example.com A
nslookup example.com
# Your public IP from a terminal
curl https://ifconfig.me
Frequently asked questions
What is an IP address in simple words?
An IP address is a number that identifies a device or server on a network, like a postal address for computers. It tells data where to go and where it came from.
What is the difference between IPv4 and IPv6?
IPv4 uses 32-bit addresses written in four decimal numbers and offers about 4.3 billion addresses. IPv6 uses 128-bit addresses written in hexadecimal and offers a practically unlimited supply. IPv6 was created because IPv4 addresses are running out.
Do I need a dedicated IP address for my website?
Usually not. Modern web servers and free SSL certificates work fine on a shared IP. A dedicated IP can help for certain email sending needs, for reaching your site by IP, or for strict firewall rules.
Can two websites share the same IP address?
Yes. A web server reads the domain name sent in the HTTP request, or in the TLS handshake with SNI, and serves the matching site. This is how thousands of sites share one IP on shared hosting.
What is a private IP address?
A private IP address belongs to ranges reserved for local networks, such as 192.168.x.x or 10.x.x.x. Devices with private addresses cannot be reached directly from the internet and use NAT to access it.
Can an IP address reveal my exact location?
Not precisely. An IP address usually maps to a city or region and an internet provider, not a street address. Accuracy varies, and VPNs or mobile networks can place the address far from the real location.
Related topics
- IPv4 vs. IPv6 Networking & IP
- What Is a Web Server? Web Servers
- What Is DNS (Domain Name System)? Domains & DNS
- What Is Shared Hosting? Hosting Basics
- What Is a Domain Name? Domains & DNS