ESC

Start typing to search across invoices, services, domains, tickets, and more...

Search... Ctrl+K
IP & ASN

How to Set Up rDNS / PTR Reverse DNS for an IP: Email Reputation and dig -x Verification

5 steps 8 min read 7 views 0
On this page

Reverse DNS (rDNS) maps an IP address back to a hostname, and the DNS record that stores it is the PTR record. The main reason to set up rDNS / PTR for an IP is email reputation: Gmail, Outlook and most mail servers check whether the sending IP has a PTR and whether it matches the forward record, and mail that fails is likely to land in spam or be rejected. This article explains how to request rDNS for IMIDC servers and leased IPs and how to verify it on Linux and Windows.

Step 1: Understand who manages rDNS and PTR records

Forward records (A records) live with your domain's DNS provider and you edit them yourself. PTR records belong to the owner of the IP space and are maintained by the RIR member that assigned the IP, in this case IMIDC. That is why you cannot set a PTR at your domain registrar. Customers with many custom entries on a whole /24 can also ask for the reverse zone to be delegated to their own name servers.

whois 203.0.113.10 | grep -iE "inetnum|netname|org|mnt-by|country"

Step 2: Create the forward A record first

The hostname used in the PTR must resolve back to the same IP. This is called forward-confirmed reverse DNS (FCrDNS). Add an A record such as mail.example.com pointing to 203.0.113.10 and confirm it is live. Use a domain you control, not a generic IP-based name.

; zone example.com at your DNS provider
mail.example.com.    3600    IN    A    203.0.113.10

dig +short A mail.example.com

Step 3: Request rDNS from IMIDC via a ticket

Log in to the client area and open a ticket listing each IP and its hostname, one pair per line; you can submit many IPs at once. Our engineers will reply once it is done. If you see an rDNS option on your service's management page you can also change it yourself; if not, a ticket is always the way.

IP: 203.0.113.10        PTR: mail.example.com
IP: 203.0.113.11        PTR: web1.example.com
For mail servers, give each sending IP its own unique PTR and match it with the SMTP HELO/EHLO name. Because of DNS caching, changes usually propagate within minutes to a few hours.

Step 4: Verify reverse DNS with dig -x

Install the DNS tools on Linux and query the PTR with dig -x or host. If your hostname is returned, the setup works.

# Debian / Ubuntu
apt install -y dnsutils
# CentOS / Rocky / AlmaLinux
dnf install -y bind-utils
dig -x 203.0.113.10 +short
host 203.0.113.10

On Windows Server 2016/2019/2022 use Command Prompt or PowerShell:

nslookup 203.0.113.10
Resolve-DnsName -Name 203.0.113.10 -Type PTR

Step 5: Check forward/reverse consistency (FCrDNS) and configure mail

The small script below reads the PTR hostname, then looks up its A record; both must point to the same IP. Then set the same name on your mail server, for example in Postfix:

ip=203.0.113.10
ptr=$(dig -x $ip +short | sed 's/\.$//')
echo "PTR: $ptr"
echo "A:   $(dig +short A $ptr)"
postconf -e 'myhostname = mail.example.com'
postconf -e 'smtp_helo_name = $myhostname'
systemctl restart postfix

For good deliverability also publish SPF, DKIM and DMARC; rDNS is only the foundation.

FAQ

Why does dig -x still return the old PTR?

A local or recursive DNS cache may not have expired yet. Query another resolver with dig -x 203.0.113.10 @1.1.1.1 or wait until the TTL runs out.

Can I point a PTR to someone else's domain?

Technically yes, but don't. Use a domain you own with a matching A record; otherwise FCrDNS fails, it does nothing for reputation and may be considered abuse.

Can one IP have multiple PTR records?

It is not recommended. Multiple PTRs make some mail servers fail their checks; one PTR per IP is the safe choice.

Still stuck? Open a ticket with IMIDC 24/7 technical support.

Was this answer helpful?

Related Tutorials