Updated on 2025-12-24 GMT+08:00

Overview

What is a PTR Record?

A PTR record provides the domain name associated with an IP address. It is the opposite of a regular DNS lookup. PTR records are used in many network applications. For example, email servers use reverse resolution to verify the sender's IP address to reduce spam and network fraud.

After a recipient server receives an email, it checks whether the IP address and domain name of the sender server are trustworthy and determines whether the email is spam. If the recipient server fails to obtain the domain name mapped to the sender's IP address, it concludes that the email is sent by a malicious host and rejects it. It is necessary to configure pointer records (PTR) to point the IP addresses of your email servers to domain names.

Reverse Resolution Process

In the following figure, an ECS serves as an email server, and a PTR record is configured to map the EIP of the ECS to the domain name configured for accessing the email server.

Figure 1 Reverse resolution
For example, enterprise A deploys their email service on an ECS (email server) and binds an EIP to the ECS to enable public network communication. Enterprise B receives emails from a local email recipient (such as an enterprise email client or server) and uses DNS for reverse lookup verification.
  1. Enterprise A sends an email, and enterprise B receives the request: The email recipient (for example, the local email server) receives an email from the external network.
  2. Enterprise B triggers reverse resolution to query the domain name mapped to the email server IP address of enterprise A: To verify that the email is not a spam email from a forged IP address, the email recipient of enterprise B proactively sends a reverse resolution request to the DNS server to query the domain name mapped to the email server IP address of enterprise A (that is, the EIP).
  3. The DNS server returns the resolution result: The DNS server returns the domain name (for example, mail.companyA.com) mapped to the email server IP addresses of enterprise A to the email recipient of enterprise B based on the mapping between the IP address and domain name.
  4. If the verification is successful, the recipient receives the email: The email recipient of enterprise B checks whether the domain name obtained from the reverse resolution is the same as the actual domain name of the email. If the domain names are the same, the email recipient returns a message indicating that the email has been received to the EIP (associated with the ECS) of enterprise A.

The preceding describes the reverse resolution process of the DNS service. Information about how the email recipient checks the credibility of the sender's IP address and whether the domain name is available on the Internet is not provided here.

If no PTR records are configured, the recipient server will treat emails from the email server as spam or malicious and discard them. Therefore, if you want to build an email server, it is necessary to add a PTR record to map the email server IP address to your domain name.

Related Operations

Table 1 PTR record operations

Operation

Scenario

Constraints

Creating a PTR Record

Create PTR records for cloud resources such as ECS.

  • PTR records are project-level resources. When you create a PTR record, you need to select a region and project.
  • You can add up to 50 PTR records in your account.

Managing PTR Records

Modify, delete, batch delete, or query PTR records.

  • After a PTR record is created, the EIP cannot be changed.
  • After you delete a PTR record, the domain name mapped to the EIP will change to the default domain name.