What Is a PTR Record in DNS?

Every device connected to the Internet has a unique IP address. You may never know your IP address, but other devices wouldn’t be able to reach you without it. If you have an IP address and want to know the associated domain name, then a PTR record tool is the tool to use. In this article, learn what a PTR record is, where it's used, and how it works.

What is a PTR record?

A PTR record, also known as a pointer record, is a type of DNS record that maps an IP address to a domain name. While regular DNS helps translate domain names to numerical IP addresses that computers can understand, a PTR record provides a domain name associated with a particular IP address. 

What is a PTR record?

A pointer record is a part of DNS that allows for a reverse DNS lookup, thus correlating IP addresses with domain names. Depending on your operating system, you can perform a reverse DNS lookup using the DNS PTR tool or other command-line tools. When the user enters the IP address, the tool queries the DNS servers to determine the associated domain name. You get a web address you can easily read. 

DNS PTR records were introduced along with the initial specifications of the DNS in 1987. The core functionality of DNS, including both forward lookups (domain to IP) and reverse lookups using pointer records, were defined in the original RFC 1034 and 1035 documents. 

These RFCs laid the groundwork for the DNS system we use today. Since pointer records are a fundamental part of reverse DNS lookups, their introduction dates back to the very beginning of the DNS. PTR records are the opposite of A records, which point hostnames to IP addresses. 

PTR records must be stored within a reverse DNS zone. The zone can hold multiple pointer records, correlating a different IP address with its domain name.

How PTR records work

PTR records function differently for IPv4 and IPv6 addresses due to their structure and storage within the domain name system.

IPv4 and IPv6 PTR records serve the same purpose - enabling reverse DNS lookups to translate an IP address back to its corresponding domain name. Pointer records for both versions exist within a special DNS system zone called a reverse DNS zone. This zone is separate from the regular DNS zones that store A records.

In IPv4, PTR records reside in the “in-addr.arpa” namespace. This namespace is appended to the reversed IP address to form the complete zone name.
For example, to perform a reverse lookup for the IP address 192.168.1.1, the zone name would be “1.1.168.192.in-addr.arpa.”

IPv4 addresses consist of 4 octets (8-bit sections). Pointer records in the in-addr.arpa zone store them in reverse order, where each octet becomes a separate label.

IPv6 PTR records use the “ip6.arpa” namespace. Similar to IPv4, the reversed IP address is divided into sections and appended to the namespace to create the zone name. 

For instance, a reverse lookup for the IPv6 address fe80::200:57ff:fe9b:6c80 would involve the zone “0.c8.b9.ff.fe.57.00.20.fe.80.in-addr.arpa."

IPv6 addresses consist of 8 groups of 16-bit hexadecimal values. PTR records in the ip6.arpa zone reverse the order and convert each into 4-bit sections, as opposed to IPV4’s 8-bit sections.

What’s inside a PTR record?

A pointer record is straightforward with just a few key pieces of information.

  • TYPE: PTR - This identifies the record type as a pointer record.
  • Host - The field specifies the IP address in dotted-decimal format (IPv4) or colon-hexadecimal format (IPv6). It acts like the key we're using for the lookup.
  • Points to - This section holds the domain name associated with the IP address in the "Host" field. It's the information we're trying to find through the reverse lookup.
  • TTL (Time To Live) - This value determines how long DNS resolvers can cache a DNS record before they refresh it by querying the DNS server again. The TTL value for PTR records typically doesn't need long, often set around 72 hours.

What does a PTR record look like?

A PTR record has a specific format. Here's an example of what a pointer record might look like:

10.0.0.1.in-addr.arpa. IN PTR  hostname.example.com.  3600

10.0.0.1.in-addr.arpa defines the location of the record within the DNS. 

  • 10.0.0.1 is the reversed IP address, which is IPv4 in this case.
  • .in-addr.arpa is the namespace used for reverse DNS lookups in IPv4.

IN signifies the record class, typically "IN" for Internet records. 

PTR specifies the record type, which is "PTR" for a pointer record. 

hostname.example.com is the domain name associated with the IP address 10.0.0.1. 

3600 is the Time To Live (TTL) value in seconds, indicating how long other DNS servers can cache this record before refreshing it.

You won't see pointer records directly unless you use a tool to perform a reverse DNS lookup. This is due to the fact that the DNS record type is managed by the network administrator or hosting provider associated with the IP address.

Why do you need PTR records?

As a part of reverse DNS, a PTR record verifies the IP addresses. Users need pointer records for a number of reasons.

Domain name lookups

Practically, a pointer record is fundamental in the DNS system. It enables DNS lookups and plays a critical role in controlling access to resources. 

Users leverage a PTR tool to perform reverse DNS lookup queries and then get pointer records from IP addresses. The tool is useful in mapping an IP address to a canonical hostname that users can read and understand easily.

Email security

The PTR record adds a layer of security to prevent email spoofing. Email servers often use pointer records to verify the legitimacy of incoming emails. If an email originates from a server without a valid pointer record, it could receive a spam flag.

The absence of a PTR record in the email headers is treated as suspicious behavior. The record validates whether or not the sending server's IP address matches the domain name declared in the email's SMTP transaction.

Network troubleshooting 

When diagnosing network issues, knowing the domain name associated with an IP address can help identify the source of the problem. PTR records provide a way to map an IP address to a domain name, which helps identify the source of network-related issues, such as email delivery problems.

Website analysis

Website owners can use PTR records to understand the origin of their website traffic by looking at the domain names associated with visiting IP addresses.

Tracing dedicated subnets

Users can name subnet sections with human-readable domains instead of IP addresses. You can conveniently trace dedicated subnets. 

Logging

Many system logs store only IP addresses. Using reverse lookups allows you to read logs more easily, as the IP address translates into its specific hostname.

This makes important processes like system changes, errors, and warnings easier to interpret. 

How do you create a PTR record?

Creating a pointer record can be a complex process requiring knowledge of DNS configuration. It involves coordinating with your network administrator or Internet service provider. 

You can create a pointer record, although you first need to ensure you’ve created your zone file. Here are the steps to follow.

Determine your IP address

To find your IP address on Windows, open the search bar and type cmd. Then click the black and white window that appears.

Inside Windows, type ipconfig /all and press Enter. Look for IPv4 Address as this is your code. On Mac, open the terminal and type curl ifconfig.me. Your code will display.

Pick your domain name

This is the user-friendly website address you want to associate with your web server, email server, or other network resources. If it's for a website, then the domain name is the one you use to access the website.

Contact your ISP or hosting provider

The network administrator or hosting provider that manages your IP creates PTR records. This could be your Internet service provider (ISP) for a home network or your web hosting company for a website.

Since you don't directly manage the DNS servers where PTR records reside, you need to contact the entity responsible. You'll then provide them with the IP address and the domain name you want linked.

Verify the record

This step is optional but helpful to confirm if the pointer record was created correctly. You can use tools like ‘nslookup’ on Windows to perform a reverse DNS lookup. This lookup queries the DNS system and tells you if a PTR record exists for the IP address and, if so, what domain name it associates with.

It might take a little while for the changes to take effect across the Internet.

Frequently asked questions

What is reverse DNS lookup (rDNS)? 

A reverse DNS lookup is the process of querying the domain name system (DNS) to determine the domain name chiefly associated with a given IP address. It's the opposite of a traditional DNS lookup. 

Are PTR records necessary for emails?

Yes. Properly configured pointer records contribute to spam prevention efforts. Many spam filters and email security systems use PTR records as criteria for determining the legitimacy of incoming emails.

Can I have multiple pointer records for one IP address?

No. A PTR record maps an IP address to a domain name, and there should ideally be only one PTR record per IP address. Having multiple records for the same IP address may cause issues with reverse DNS lookups.

While having PTR records is not mandatory according to Internet standards, their absence can lead to various email deliverability issues. Servers without pointer records may be treated with suspicion and have their emails blocked by spam filters.

PTR record is the reverse of A record, as per the DNS system. However, for every PTR record, there must be an A record already in existence.

What is a DNS PTR tool?

A PTR record tool is a type of software that allows users to perform reverse DNS lookups to query PTR records for a given IP address.

Author

Written by Lizzy Schinkel & WhatIsMyIP.com® Editorial Contributors

Lizzy is a tech writer for WhatIsMyIP.com®, where she simplifies complex tech topics for readers of all levels. A Grove City College graduate with a bachelor’s degree in English, she’s been crafting clear and engaging content since 2020. When she’s not writing about IP addresses and online privacy, you’ll likely find her with a good book or exploring the latest tech trends.

Reviewer

Technically Reviewed by Brian Gilbert

Brian Gilbert is a tech enthusiast, network engineer, and lifelong problem solver with a knack for making complicated topics simple. As the overseer of WhatIsMyIP.com®, he combines decades of experience with a passion for helping others navigate the digital world.