Skip to content

NetworkingIP addresses & IPv6

Reverse DNS (PTR) for your server's IP address

What reverse DNS is, why mail servers need a matching PTR record, how to check it with dig or PowerShell and how to have it set for your HyperDC IP address.

  • Beginner
  • 8 min read
  • Updated

Tested on: Ubuntu 24.04 LTS, Ubuntu 26.04 LTS, Debian 12, Debian 13, Windows 11

This guide is not available in your language yet, so it is shown in English.

On this page
  1. Before you start
  2. Step 1: Check the current PTR record
  3. Step 2: Create the forward record first
  4. Step 3: Have the PTR record set
  5. Step 4: Match the server's own host name
  6. IPv6
  7. Troubleshooting
  8. Next steps

Forward DNS turns a name into an IP address. Reverse DNS does the opposite: a PTR record turns an IP address back into a name. Receiving mail servers check it, so a server that sends email needs a PTR record that matches its host name. Replace 203.0.113.10 and mail.example.com with your values.

Before you start

  • Know the IP address that needs the record: Services › My Services, open the server, Server Information (Primary IP and Assigned IPs).
  • Choose a host name in a domain you control, for example mail.example.com.

Step 1: Check the current PTR record

Linux and macOS

Bash
dig -x 203.0.113.10 +short

Windows

PowerShell
Resolve-DnsName 203.0.113.10 -Type PTR

The answer may be a generic name or empty. If it is empty, no PTR record exists yet.

Step 2: Create the forward record first

Mail servers use forward-confirmed reverse DNS: the PTR name must resolve back to the same IP address. At your DNS host, create:

TypeNameValue
Amail203.0.113.10
AAAAmailyour IPv6 address (if the server sends mail over IPv6)

Verify: dig mail.example.com A +short returns 203.0.113.10.

Step 3: Have the PTR record set

HyperDC controls the reverse zones of its IP addresses, so the PTR record is set on our side:

  • If your service page offers a reverse DNS option (in the Actions menu or the Manage card), enter the host name there.
  • Otherwise Open Ticket, choose the server under Related Service and write the IP address and the host name you want, for example: "Please set the PTR record of 203.0.113.10 to mail.example.com."

Verify: after the change, both directions match:

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

The first command returns mail.example.com. and the second 203.0.113.10.

Step 4: Match the server's own host name

Give the server the same name, so the mail server announces it in its greeting (HELO/EHLO):

Bash
sudo hostnamectl set-hostname mail.example.com
hostnamectl

Make sure /etc/hosts maps the name to the server, for example with the line 203.0.113.10 mail.example.com mail, and set the same name in your mail server's configuration (for Postfix, myhostname).

Note that outbound port 25 is closed by default on HyperDC VPS. For services bought for a term of 3 months or longer, it is opened on request when you open a support ticket. Until then, send mail through a relay on port 587.

IPv6

Each IPv6 address that sends mail needs its own PTR record and a matching AAAA record. If you are not ready to maintain IPv6 for mail, configure the mail server to send over IPv4 only, so receivers do not see an IPv6 address without reverse DNS.

Troubleshooting

The PTR record shows the old name. Resolvers cache it until its TTL expires. Ask the authoritative reverse servers directly with dig -x 203.0.113.10 +trace.

Mail is still rejected for "reverse DNS does not match". The A record of the PTR name points elsewhere, or the mail server sends from another IP address. ip route get 1.1.1.1 shows the source address (src) the server uses for outgoing traffic.

The forward name does not resolve. The A record was created at a DNS host the domain does not use. See DNS not resolving.

Next steps

Frequently asked questions

Can I set the PTR record in my domain's DNS zone?

No. Reverse DNS lives in a zone that belongs to whoever controls the IP address, which for your server's addresses is HyperDC. Your domain's zone holds the forward record that the PTR name must match.

What should the PTR name be?

A fully qualified host name in a domain you control, such as mail.example.com, that has an A (or AAAA) record pointing back to the same IP address. Mail servers check this round trip.

Do I need reverse DNS for a web server?

Websites work without it. It matters for sending email, and some services and logs look nicer with it, but browsers do not check it.

How long does a PTR change take?

Once set, it is visible after the TTL of the old PTR record expires, usually within minutes to a few hours.

Can every IPv6 address of my /64 get a PTR record?

Reverse DNS can be set per IPv6 address. Ask only for the addresses that send mail or need a name, and include each full address in your request.

Generer passord

Please confirm