How do I enable reverse DNS functionality for Route 53 with a PTR record?

Last updated: 2021-04-30

I need to configure reverse domain name service (DNS) resolution for a server using Amazon Route 53. How can I do this?

Short description

To configure reverse DNS resolution for a Simple Mail Transfer Protocol (SMTP) server, you must first determine the appropriate method for your use case:

  • If you have an on-premises SMTP server and you use non-AWS resources, your IP addresses might be owned by a third party. The third party might be another cloud computing platform or your internet service provider (ISP). In this case, you must use the method provided by the IP address owner to configure reverse DNS. The IP address owner might require you to create a reverse DNS record and provide only the name servers to them for delegation. In this case, complete the Resolution steps in the "Using on-premises SMTP servers" section. You must configure Route 53 to respond to reverse DNS lookup queries for your server by creating a public hosted zone. Then, you must add a pointer (PTR) record in it.
  • If you have an SMTP server hosted in Amazon Virtual Private Cloud (Amazon VPC) and you use AWS-provided Elastic IP addresses for your servers, complete the Resolution steps in the "Using SMTP servers hosted in Amazon VPC" section to configure reverse DNS.

Resolution

Using on-premises SMTP servers

Note: This resolution uses the following example IP addresses for the SMTP server: 1.2.3.4 (IPv4) and 2000:1234:5678:9012:3456:7890:1234:5678 (IPv6).

Create a public hosted zone

Create a public hosted zone for your server’s IP address. For example: 3.2.1.in-addr.arpa (IPv4) or 2.1.0.9.8.7.6.5.4.3.2.1.0.0.0.2.ip6.arpa (IPv6).

Create a record set and PTR record

  1. Create a record set for your hosted zone.
  2. Create a PTR record for your SMTP server.
    For Name, enter the reversed IP address plus in-addr.arpa (IPv4) or ip6.arpa (IPv6). For example, 4.3.2.1.in-addr.arpa (IPv4) or 8.7.6.5.4.3.2.1.0.9.8.7.6.5.4.3.2.1.0.9.8.7.6.5.4.3.2.1.0.0.0.2.ip6.arpa (IPv6).
    For Type, choose PTR – Pointer.
    For Value, enter the fully qualified domain name (FQDN) of the SMTP server. For example, mail.example.com.
    Note: If your domain has multiple IP blocks, you must create additional reverse hosted zones with corresponding PTR records to resolve the IP addresses.

Set up delegation

After you create the PTR record, you must ask the IP address owner to set up delegation to the name servers in your reverse hosted zone. To locate name server details, follow these steps:

  1. Open the Route 53 console.
  2. In the navigation pane, choose Hosted zones.
  3. Select your hosted zone.
  4. For Type, choose NS.
  5. Note the record’s Value.

Note: The time for this new configuration to take effect depends on the time to live (TTL) records of the previous NS record. Note that the TTL records of the previous name server (NS) record might be cached in end-user local DNS servers.

Using SMTP servers hosted in Amazon VPC

  1. Create a forward DNS record (record type A) that points to the appropriate Elastic IP address.
  2. Create or update the reverse DNS record for an Elastic IP address: