Reverse DNS lookups and PTR records

更新时间:
复制 MD 格式

A forward DNS lookup maps a domain name to an IP address. A reverse DNS lookup maps an IP address to a domain name.

Reverse DNS lookup

A single IP address can be associated with multiple domain names. A reverse DNS lookup resolves an IP address to its corresponding domain name. However, it is not feasible to search the entire Domain Name System (DNS) to find this mapping. To solve this, RFC 1035 defines the PTR (Pointer) record. A PTR record maps an IP address to a domain name.

Configuration procedure

  1. Create a reverse lookup zone for the IP address network.

  2. In the corresponding reverse lookup zone, add the required PTR records.

For example, if your network address range is 192.168.0.1-192.168.0.255, which is part of the 192.168.0.0/24 network, the corresponding reverse lookup zone is 0.168.192.in-addr.arpa. When you add a PTR record in the zone 0.168.192.in-addr.arpa with the host set to 1 that points to www.example.com, the reverse DNS lookup for the IP address 192.168.0.1 resolves to www.example.com.

In a private network environment, you can manage the following reserved address ranges and create reverse lookup zones.

  • 10.0.0.0 - 10.255.255.255

  • 172.16.0.0 - 172.31.255.255

  • 192.168.0.0 - 192.168.255.255

Important

To add a PTR record for a public IP address, see What is a reverse DNS lookup.

Add a PTR record in Private DNS

To add a reverse lookup zone for the 192.168.1.0/24 address range:

Note

The name of the reverse lookup zone for this address range is 1.168.192.in-addr.arpa. The .in-addr.arpa is a fixed suffix.

  1. Go to Alibaba Cloud DNS - Private DNS.

  2. On the Authoritative Zone page, select the User Defined Zones tab and click Add Zone.

  3. In the Authoritative Zone field, enter the reverse lookup zone. In this example, enter 1.168.192.in-addr.arpa. Then, submit the form.

    Enable subdomain recursive resolution proxy. In the Effective Scope Settings, select the target Alibaba Cloud VPC or self-hosted DNS cluster.

  4. On the User Defined Zones tab, find the newly added authoritative zone and click Settings in the Actions column.

  5. Click Add Record. Add a PTR record, set the host to 1, and point it to host001.example.com.

    In form-based mode, select Default for request source and set the TTL to 5 seconds.

  6. Submit the form.

Set the scope

  1. On the User Defined Zones tab, click Effective Scope in the Actions column for the target zone. In the Effective Scope dialog box, you can configure two scopes: Effective in Alibaba Cloud VPC and Effective in Self-built DNS Cluster. In the Effective in Self-built DNS Cluster section, select the desired self-built DNS cluster from the drop-down list, such as office network or default resolution cluster. To prevent resolution failures from an empty zone, we recommend setting the effective scope only after you configure DNS records.