IPv6 and reverse DNS, set up properly

Each machine arrives with one IPv4 address and an IPv6 block. Here is how to use both and give the IPv4 a clean reverse name.

What addresses come with a server?

Every machine in every location is delivered with one public IPv4 address and a block of IPv6 addresses. Both are shown on the server page in the console. The IPv4 address is configured by the installer at delivery; the IPv6 block is assigned to your machine and you decide which addresses inside it to use. Additional IPv4 addresses are not part of our offer, which is one reason IPv6 is worth setting up from day one.

Why bother with IPv6?

A large and growing share of mobile and home connections reach the internet over IPv6 first, and many networks treat IPv4 as the fallback path. Serving both means those visitors connect directly instead of through translation gear at their provider. A block also gives you far more addresses than you can use: you can give each website, container or virtual machine its own address, separate services cleanly in your firewall and logs, and still have room left over.

How do I configure IPv6 on Ubuntu?

Recent Ubuntu Server releases use netplan. Edit the file in /etc/netplan/, add the address from your block and the gateway shown in the console, then apply. The example uses the documentation prefix 2001:db8::/32; replace it with your own values.

network:
  version: 2
  ethernets:
    eno1:
      addresses:
        - 2001:db8:1234:5600::1/64
      routes:
        - to: "::/0"
          via: 2001:db8:1234:56ff:ff:ff:ff:ff
          on-link: true
sudo netplan try

netplan try rolls the change back after 120 seconds unless you confirm it, which protects you from locking yourself out. On Debian with ifupdown the same settings go in /etc/network/interfaces as an inet6 static stanza; on AlmaLinux and Rocky Linux use nmcli connection modify with ipv6.addresses, ipv6.gateway and ipv6.method manual.

How do I check that IPv6 works?

ip -6 addr show
ip -6 route show default
ping -6 -c 4 2606:4700:4700::1111
curl -6 https://ifconfig.co

If the ping fails, check the interface name, the prefix length and that the gateway is marked on-link. Then publish an AAAA record for your host name next to its A record, and make sure your web server, mail server and firewall listen on IPv6 too. A common mistake is a firewall that allows port 443 on IPv4 only.

What is reverse DNS and why does mail care?

Normal DNS maps a name to an address. Reverse DNS does the opposite: a PTR record maps the address back to a name. Mail servers receiving your messages look up the PTR of your sending IP and usually expect it to match a name that resolves back to the same IP, known as forward-confirmed reverse DNS. Without it, mail is often filtered or refused. Logs and traceroutes also read far better when your address shows a real host name.

Where is the PTR record for the IPv4 address edited?

Open the server page in the console and edit the reverse DNS of the IPv4 address. Enter a fully qualified name such as mail.example.com. Before you save, create the A record for that name pointing to the server, because the reverse entry should only point to a name that already resolves forward. Then verify:

dig +short -x 203.0.113.10
dig +short mail.example.com A

Both answers should agree. Set the mail server host name (for Postfix, myhostname) to the same name so the greeting, the PTR and the A record all match.

What should a mail server check besides the PTR?

Publish an SPF record listing the server, sign messages with DKIM and add a DMARC policy. Warm up the address slowly if it is new. Keep the server patched and never run an open relay; our network usage rules forbid it, and a relay that anyone can use is the fastest way to ruin an address reputation.

Can I route addresses to virtual machines?

With IPv6, yes: assign addresses from your block to guests on a bridge or route a smaller range to them. With a single IPv4 address, guests share it through NAT or a reverse proxy on the host. The Proxmox VE guide shows both layouts.

Related pages

Hardening a new dedicated server

The first hour on a fresh machine: SSH keys, a firewall, automatic updates, brute force blocking and a habit of checking what listens.

Read more

Ubuntu Server

The default pick for most rentals: 24.04 or 22.04 LTS, recent kernels for new EPYC and Ryzen chips, five years of updates.

Read more

Proxmox VE

Proxmox VE 9 turns the machine into a hypervisor with a web interface for KVM virtual machines and LXC containers.

Read more

Choosing a data centre location

Latency, traffic rules, data residency and price: how to pick one of our twelve data centres for the people you serve.

Read more

Questions and answers

How many IPv4 addresses come with a server?

One public IPv4 address per machine, plus a block of IPv6 addresses. Extra IPv4 addresses are not sold.

Where do I find my IPv6 block and gateway?

On the server page in the console, next to the IPv4 address.

Is the PTR name of the IPv4 address under my control?

Yes. The server page in the console has a field for it. Create the matching A record first so the name resolves forward.

Why are my emails rejected?

A missing or mismatched PTR record is a common cause. Also check SPF, DKIM and DMARC, and that the mail host name matches the reverse name.

Can virtual machines get public addresses?

Over IPv6, yes, from your block. Over IPv4 they share the host address through NAT or a reverse proxy.