Skip to content
Current coupon:10% offUse it in your order

Reverse DNS (rDNS/PTR) for your VPS's IP address

What reverse DNS is for, how to set a PTR record for your VPS's IPv4 and IPv6 addresses in the Network tab, why the A record has to match too, and how to check it all with dig.

  • advanced
  • ~5 min
  • Updated 2 Oct 2026

Reverse DNS (a PTR record) maps an IP address back to a name. You set it in the customer area for each of your VPS's IP addresses. It matters most for a mail server: without correct rDNS, the big email providers reject your messages or send them to spam.

What you'll need

  • A StormHost VPS and the Network and rDNS permission (the owner always has it)
  • Your own domain and access to its DNS records
  • An SSH connection to the VPS as root (guide) to set the hostname
  • About 5 minutes (plus waiting for DNS)

What rDNS is for#

A regular A record says “mail.example.cz is 203.0.113.10”. A PTR record says the opposite: “203.0.113.10 is mail.example.cz”. You don't manage the PTR in your own domain but in the reverse zone, which belongs to the owner of the IP address. For our VPS, you therefore set it in the customer area.

Mail servers check that both directions match (this is called forward-confirmed rDNS):

  1. The sender's IP address has a PTR record with a name (203.0.113.10 points to mail.example.cz).
  2. That name has an A (or AAAA) record with the same IP address (mail.example.cz points to 203.0.113.10).

Google requires this match from email senders. Besides email, rDNS makes traceroute output and logs easier to read.

Every IP address has a default PTR record from us, in the form 203-0-113-10.stormhost.eu, for example. You don't need to change it for a website or game server.

The A record first#

The customer area doesn't check whether the name really points to your IP. You have to make sure they match yourself, otherwise rDNS won't help with mail servers.

  1. In your domain's DNS management, create an A record: name mail, value your VPS's IPv4 address (for example 203.0.113.10). For IPv6, also add an AAAA record with the same name.

  2. Check that the record works:

    bash
    dig +short mail.example.cz A
    • dig +short – prints only the record's value.
    • mail.example.cz A – the name you're looking up and the record type. Replace mail.example.cz with your name.

    The output must be your VPS's IP address. The Windows steps and more about DNS are in DNS records explained.

No proxy

In Cloudflare, the rDNS name (typically a mail server) must have the DNS only proxy status (gray cloud). With a Proxied record, the name would point to a Cloudflare IP address and the match would fail.

Setting rDNS for IPv4#

  1. In the customer area, open My services, click the VPS and go to the Network tab.

  2. Scroll down to the Reverse DNS (rDNS) section. For each IPv4 address you see the current PTR record; the default one has the default tag.

  3. In the text field below the right IP address, type the name, for example mail.example.cz. An empty field shows the default name in gray.

  4. Click Save.

    You'll see rDNS for 203.0.113.10 set to mail.example.cz.

The Restore default button (shown only for a custom name) resets the PTR to the default name. Saving an empty field does the same.

The IP addresses are masked

By default, streamer mode is on and masks IP addresses and names. To see which address you're typing for, click Show details at the top.

Rules for the name:

RuleExample
At least two parts separated by a dot, 4 to 253 characters in totalmail.example.cz yes, mail no
Only the letters a–z, digits and hyphens; no hyphen at the start or end of a partmx-1.example.cz yes, -mx.example.cz no
The last part can't be digits onlyserver.123 no
Names in the stormhost.eu domain are reserveduse your own domain

Uppercase letters and a trailing dot are adjusted automatically. You can set at most 32 custom PTR records per service.

Setting rDNS for IPv6#

A VPS has a whole range of IPv6 addresses (/64), so rDNS for IPv6 is entered differently:

  1. In the Reverse DNS (rDNS) section, find rDNS for other addresses in your range.
  2. In the IP address from the range field, type a specific IPv6 address, for example 2001:db8::10 (you'll find the VPS's main IPv6 address higher up in the Network tab).
  3. In the Hostname field, type the name, for example mail.example.cz.
  4. Click Save.

The address you set then appears in the list above the form, with the Restore default option. You can set rDNS only for addresses assigned to your VPS.

Server hostname#

A mail server introduces itself to others with the system's name. Set it to the same name as the PTR. This works on both Ubuntu 24.04 and Debian 13:

bash
hostnamectl hostname mail.example.cz
  • hostnamectl – the systemd tool for showing and changing the system name.
  • hostname mail.example.cz – sets the system name immediately (without a restart) and permanently; the permanent name is written to /etc/hostname. Replace mail.example.cz with your name.

So the system knows the name even without a DNS lookup, add it to /etc/hosts. On a server with a static IP address, it belongs on the line with that IP:

/etc/hoststext
127.0.0.1       localhost
203.0.113.10    mail.example.cz mail
  • 203.0.113.10 – the VPS's IPv4 address.
  • mail.example.cz – the full name (FQDN); it must come first on the line.
  • mail – the short name.

Edit the file with nano /etc/hosts (save with Ctrl+O and Enter, exit with Ctrl+X). Add the new line below the 127.0.0.1 localhost line, and leave the other lines already in the file as they are.

A file managed by cloud-init

If /etc/hosts starts with a comment saying it's managed by cloud-init (manage_etc_hosts), it's regenerated every time the VPS starts and your change disappears. In that case, make the change in the template the comment names (on both Ubuntu and Debian, /etc/cloud/templates/hosts.debian.tmpl), not directly in /etc/hosts.

Check:

bash
hostname -f
  • hostname -f – prints the system's full name (FQDN). It should print mail.example.cz.

The system name alone isn't enough, though: set the same name in your mail server's configuration too (for example myhostname in Postfix).

Verification#

  1. Check the PTR record:

    bash
    dig +short -x 203.0.113.10
    • -x 203.0.113.10 – a reverse query: you ask about an IP address instead of a name. Replace 203.0.113.10 with your VPS's IP.
    Outputtext
    mail.example.cz.
  2. Check that the name points back to the same IP: dig +short mail.example.cz A.

On Windows, use nslookup 203.0.113.10: the Name: line shows the name from the PTR record. For IPv6, dig +short -x 2001:db8::10 works the same way.

PTR records have a TTL of 1 hour. If you looked up the IP address before the change, the new name may take a while to show up.

Troubleshooting#

Enter a valid hostname (e.g. mail.example.com).#

The name doesn't meet the rules in the table above: it's missing a dot, contains a character that isn't allowed (an underscore, a space, accented letters) or is too short.

Names in the stormhost.eu domain are reserved. Use your own domain.#

The PTR can't be set to a name in our domain. Use your own domain, or keep the default record.

rDNS can only be set for IP addresses assigned to this service.#

The IPv6 address isn't from your VPS's range (a typo), or it's the IP of another service. You'll find the range in the Network tab in the IPv6 range (/64) row.

You can have at most 32 custom rDNS records.#

You can set at most 32 custom PTR records per service. For addresses you don't use, click Restore default.

rDNS settings are not available right now. or rDNS couldn't be saved right now.#

A temporary problem on our side. Try again shortly, or message us (support).

The PTR is set, but email still ends up in spam#

rDNS is only one of the requirements. Check that the name's A record points to the same IP, and also set up SPF, DKIM and DMARC (TXT records, see DNS records explained).

The hostname goes back to the original after a VPS restart#

Some system images set the name automatically at boot through cloud-init. If the /etc/cloud folder exists on your VPS, create a settings file that stops cloud-init from changing the name:

bash
echo "preserve_hostname: true" > /etc/cloud/cloud.cfg.d/99-hostname.cfg
  • echo "preserve_hostname: true" – prints the setting's text.
  • > – writes it to a file (overwriting an existing file).
  • /etc/cloud/cloud.cfg.d/99-hostname.cfg – your own cloud-init configuration. Files in this folder must have the .cfg extension; the number 99 makes sure it's loaded after the others.

Then set the name again with hostnamectl hostname mail.example.cz and restart the VPS. After it boots, check the name with hostname -f.

Summary

  • A PTR record maps an IP address to a name; you set it in the Network tab, in the Reverse DNS (rDNS) section.
  • The name must have an A/AAAA record with the same IP (without Cloudflare's proxy), otherwise it won't help with mail servers.
  • You enter IPv6 addresses in the “rDNS for other addresses in your range” form.
  • Set the VPS hostname to the same name (hostnamectl hostname) and check everything with dig -x.

Search the guides