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):
- The sender's IP address has a PTR record with a name (
203.0.113.10points tomail.example.cz). - That name has an A (or AAAA) record with the same IP address (
mail.example.czpoints to203.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., 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.
In your domain's DNS management, create an A record: name
mail, value your VPS's IPv4 address (for example203.0.113.10). For IPv6, also add an AAAA record with the same name.Check that the record works:
bash dig +short mail.example.cz Adig +short– prints only the record's value.mail.example.cz A– the name you're looking up and the record type. Replacemail.example.czwith 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#
In the customer area, open My services, click the VPS and go to the Network tab.
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.
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.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:
| Rule | Example |
|---|---|
| At least two parts separated by a dot, 4 to 253 characters in total | mail.example.cz yes, mail no |
| Only the letters a–z, digits and hyphens; no hyphen at the start or end of a part | mx-1.example.cz yes, -mx.example.cz no |
| The last part can't be digits only | server.123 no |
Names in the stormhost.eu domain are reserved | use 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:
- In the Reverse DNS (rDNS) section, find rDNS for other addresses in your range.
- 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). - In the Hostname field, type the name, for example
mail.example.cz. - 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:
hostnamectl hostname mail.example.czhostnamectl– 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. Replacemail.example.czwith 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:
127.0.0.1 localhost
203.0.113.10 mail.example.cz mail203.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/), not directly in /etc/hosts.
Check:
hostname -fhostname -f– prints the system's full name (FQDN). It should printmail.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#
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. Replace203.0.113.10with your VPS's IP.
Outputtext mail.example.cz.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:
echo "preserve_hostname: true" > /etc/cloud/cloud.cfg.d/99-hostname.cfgecho "preserve_hostname: true"– prints the setting's text.>– writes it to a file (overwriting an existing file)./etc/– your own cloud-init configuration. Files in this folder must have thecloud/ cloud. cfg. d/ 99-hostname. cfg .cfgextension; the number99makes 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 withdig -x.