Set reverse DNS for a cloud server

cloud, reverse dns, rdns, ptr, hostname, ip address, email, vps · 0 found this helpful

Reverse DNS turns an IP address back into a hostname. Normal DNS answers "what's the address of mail.example.ca?"; reverse DNS answers "what's the name of 203.0.113.25?". The answer is a PTR record, and only the owner of the IP address can set it, so we set it for you from your control panel.

You need reverse DNS if your server sends email. Most mail servers reject or junk mail from an address whose reverse DNS is missing or generic. It also makes your server easier to recognise in logs and traceroutes.

Before you start

  • Pick a hostname you control, like mail.example.ca or web-1.example.ca.
  • Create an A record for that hostname pointing to your server's IPv4 address. Add an AAAA record for its IPv6 address too, if you use IPv6. See Add, edit, and delete DNS records.
  • Wait until the record works. You can check with dig +short mail.example.ca, which should print your server's address.

We only accept a hostname whose A or AAAA record already points to the server. This is called forward-confirmed reverse DNS, and mail servers check for it.

Set reverse DNS

  1. Open your server in the control panel: Server.
  2. Find Reverse DNS.
  3. Enter the hostname, like mail.example.ca.
  4. Choose Save.

The change usually shows within an hour. Some networks cache the old answer for up to 24 hours.

Check it from your own computer:

dig +short -x 203.0.113.25

The answer should be mail.example.ca.

The default name

A new server's reverse DNS points to its Barbrick Cloud name, like web-1.barbrick.cloud. That's fine for logs, but if you send email, set your own hostname.

Rules

Rule Why
The hostname must resolve to the server's address Mail servers reject mail when the two don't match
One hostname per address A PTR record holds one name
No hostnames you don't control It would let a server pretend to be someone else
Managed databases and Valkey have no reverse DNS They don't have an address of their own to name

Setting reverse DNS doesn't open port 25. To send email straight from your server, see Sending email from a cloud server.

If something goes wrong

The panel says the hostname doesn't point to this server. Your A or AAAA record is missing, has a typo, or hasn't spread yet. Check it with dig +short, wait for it to show your server's address, then try again.

The server was rebuilt from a snapshot and has a new IP address. Reverse DNS belongs to the address, so set it again on the new one, after updating your A record.

You need reverse DNS for IPv6 only. Add an AAAA record for the hostname, then set it under Reverse DNS as usual. The panel checks the AAAA record against the server's IPv6 address.

Was this helpful?

Still stuck? Ask us and we'll walk you through it.