Skip to content

How to setup PTR record in Oracle Cloud Infrastructure (OCI)

Published: at 01:00 AM

Introduction

One of my VPS machines use Cloudron to easily self-host apps. And I always receive a notification from my Cloudron instance saying:

PTR DNS record (PTR) did not match.
    Hostname: <IP>
    Expected: <My Domain Name>
    Actual: null

PTR: A Pointer record reverse maps an IP address to a hostname. This behavior is the opposite of an A Record, which forward maps a hostname to an IP address. PTR records are commonly found in reverse DNS zones. For more information about PTR records, see RFC 1035.1

So I looked it up and it takes me to OCI’s Reverse DNS. As it says, reverse DNS maps an IP to a hostname.

Even though my DNS records are managed by Cloudflare, the IP belongs to OCI. PTR records are primarily used for reverse DNS lookup, and their management is typically handled by the owner of the IP address range, which, in this case, is OCI.

How-to2

  1. Create an A (IPv4) or AAAA (IPv6) forward record that points your FQDN to the IP.

  2. Open a service ticket for OCI and include the IP and FQDN that you want in the PTR. Note that you need to explicitly mention that you have finished step 1 in the ticket.

Verification

After OCI team added the PTR record, we can verify by executing dig -x <IP> and check the ANSWER SECTION contains the PTR record.

E.g. if your IP is 1.2.3.4 and the mapped FQDN is example.com, then dig -x 1.2.3.4 would return the following in the ANSWER SECTION:

4.3.2.1.in-addr.arpa. 3600 IN	PTR	example.com.

References

Footnotes

  1. https://docs.oracle.com/en-us/iaas/Content/DNS/Reference/supporteddnsresource.htm#types__dlentry_ptr

  2. https://docs.oracle.com/en-us/iaas/Content/Network/Concepts/reverse_dns.htm