Networking & DNS

IPv4 vs IPv6 explained

A plain explanation of IPv4 and IPv6 addresses, why IPv6 exists, how to read your server's address, and what each means when you connect to a VPS or point a domain at it.

Beginner4 min read

Every server on the internet needs an address so other machines can find it. There are two kinds in use today: IPv4, the original format, and IPv6, its larger replacement. This guide explains how each looks, why both exist, how to find which ones your server uses, and what that means when you connect or set up DNS.

Before you start

  • Your server's IP address from the service page in your VPS provider's control panel.
  • Optional: access to the server over SSH or Remote Desktop, to check its addresses yourself.

What an IPv4 address looks like

An IPv4 address is four numbers from 0 to 255, separated by dots:

203.0.113.10

Each number is one byte, so an IPv4 address is 32 bits long. That allows about 4.3 billion addresses in total. It sounded like plenty in the early 1980s. Today there are far more devices than that, and the free pool of new IPv4 addresses ran out years ago. That is why IPv4 addresses are scarce and why many home networks share one public address between many devices.

What an IPv6 address looks like

An IPv6 address is eight groups of four hexadecimal digits (0–9 and a–f), separated by colons:

2001:0db8:0000:0000:0000:0000:0000:0010

To keep them readable, two shortening rules apply:

  1. Leading zeros in each group can be dropped: 0db8 becomes db8.
  2. One run of all-zero groups can be replaced by ::.

So the address above is usually written as:

2001:db8::10

IPv6 addresses are 128 bits long, which gives an almost unlimited number of addresses. Networks often hand out large blocks of IPv6 addresses to a single server or customer.

Note: 203.0.113.x and 2001:db8:: are reserved for documentation. They are used in examples only and never appear on real servers.

Why both are still used

IPv6 was designed to replace IPv4, but the two are not compatible on the wire. A device with only IPv4 cannot talk directly to a device with only IPv6. So the internet runs both side by side, an arrangement called dual stack. Most modern operating systems, browsers and apps prefer IPv6 when both sides support it, and fall back to IPv4 otherwise.

Some home and mobile networks have full IPv6, others have none. That is why IPv4 is still the address everyone can reach.

Find your server's addresses

Your VPS provider's control panel shows your server's main IP address on the service page. Use that address to connect.

To see every address configured on a Linux server:

Bash
ip -brief address

Lines starting with inet style addresses (dots) are IPv4. Addresses with colons are IPv6. An address starting with fe80: is a link-local address, used only on the local network segment. You cannot use it to reach the server from the internet.

On Windows, in PowerShell:

PowerShell
Get-NetIPAddress | Format-Table InterfaceAlias, IPAddress, AddressFamily

If you are not sure whether your service has an IPv6 address, ask support in a ticket rather than guessing.

Connecting with IPv4 or IPv6

With IPv4, use the address as it is:

Bash
ssh root@203.0.113.10

With IPv6, SSH accepts the address directly:

Bash
ssh root@2001:db8::10

When a port number follows an IPv6 address, the address goes in square brackets so the colons are not confused with the port. For a Windows server with Remote Desktop on port 3389:

[2001:db8::10]:3389

With IPv4 you write 203.0.113.10:3389. In a browser, an IPv6 address also goes in brackets, for example http://[2001:db8::10]/.

DNS: A and AAAA records

When you point a domain at a server:

  • An A record points the name to an IPv4 address.
  • An AAAA record points the name to an IPv6 address.

Only add an AAAA record if the server really has a working IPv6 address and your services listen on it. A wrong AAAA record causes confusing failures for visitors who have IPv6.

Check it works

  • From your own computer, test which address family works: ping 203.0.113.10 for IPv4, and ping -6 2001:db8::10 (Windows) or ping 2001:db8::10 (recent macOS and Linux) for IPv6.
  • Check whether your own network has IPv6 by visiting an IPv6 test site in your browser.

Troubleshooting

  • SSH works on IPv4 but not on IPv6: your own network may have no IPv6, or the server firewall only allows IPv4. Check the firewall rules for IPv6.
  • "Invalid address" when you add a port: put the IPv6 address in square brackets, then add :port.
  • Some visitors cannot load your site: check that any AAAA record points to an address the web server listens on, or remove it.
  • You see an fe80: address only: the server has no public IPv6 address on that interface. Use IPv4.

Next steps

  • Point your domain at the server: Point a domain to your VPS: DNS basics.
  • Learn about ports next: What are network ports? Common ports for servers.
  • Go deeper on IPv6: IPv6 basics explained.
Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.