Look up the PTR record for any IPv4 or IPv6 address to find its associated hostname. Or perform a forward lookup to resolve a hostname to its IP addresses. Essential for email sender verification, server identification, and network diagnostics.
Enter an IPv4 or IPv6 address to find its PTR record
The Domain Name System works in two directions. Forward DNS translates a human-readable
hostname like mail.example.com into an IP address your computer can route to.
Reverse DNS does the opposite: given an IP address, it finds the hostname assigned to it.
Reverse lookups use a special DNS zone. For an IPv4 address like 8.8.8.8,
the resolver queries 8.8.8.8.in-addr.arpa — the octets reversed, with
.in-addr.arpa appended. For IPv6, the equivalent zone is ip6.arpa.
The DNS record that answers reverse queries is called a PTR record
(short for pointer record).
Unlike A records (which you manage in your domain registrar's control panel),
PTR records are managed by the owner of the IP address block — typically your ISP or
hosting provider. This means even if you own example.com, you cannot set
the PTR record for your server's IP yourself; you must request it from whoever
allocated the IP to you.
Most receiving mail servers perform a Forward-Confirmed Reverse DNS (FCrDNS) check. They look up the PTR record for your sending IP, then verify the resulting hostname resolves back to the same IP. If this check fails — or if no PTR exists — many servers reject the message or assign a high spam score. Any server sending email must have a correct PTR record.
Web servers, firewalls, and load balancers log connecting IP addresses.
When a PTR record exists, tools like traceroute and network
monitoring dashboards can show hostnames instead of raw IPs, making it far
easier to identify infrastructure and diagnose routing issues.
Reverse DNS checks are a fast signal for anti-fraud systems. An IP with no PTR record, or whose PTR record doesn't match the claimed sending domain, is a strong indicator of a misconfigured or potentially malicious sender. Many threat intelligence feeds incorporate PTR data alongside IP reputation scores.
PTR records are not set at your domain registrar — they are controlled by whoever owns the IP address block. Here is how to set one up based on your environment:
mail.example.com).
A correct setup requires both checks to pass. Run these after your PTR record is configured:
Integrate reverse and forward DNS lookups into your application with a simple REST API. Returns JSON responses with PTR records, hostnames, and IP addresses.
https://ip-api.io/api/v1/dns/reverse/{ip}
Returns the PTR record and hostname for any IPv4 or IPv6 address.
If no PTR record is configured for the IP, hostname and ttl are null
but the ptr_record zone name is always returned.
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"ptr_record": "8.8.8.8.in-addr.arpa",
"ttl": 300
}
curl "https://ip-api.io/api/v1/dns/reverse/8.8.8.8" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
response = requests.get(
"https://ip-api.io/api/v1/dns/reverse/8.8.8.8",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = response.json()
print(data["hostname"]) # dns.google
const response = await fetch(
"https://ip-api.io/api/v1/dns/reverse/8.8.8.8",
{ headers: { Authorization: "Bearer YOUR_API_KEY" } }
);
const data = await response.json();
console.log(data.hostname); // dns.google
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"https://ip-api.io/api/v1/dns/reverse/8.8.8.8");
curl_setopt($ch, CURLOPT_HTTPHEADER,
["Authorization: Bearer YOUR_API_KEY"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
echo $data["hostname"]; // dns.google
https://ip-api.io/api/v1/dns/forward/{hostname}
Resolves a hostname to all of its A (IPv4) and AAAA (IPv6) records. Useful for confirming that a PTR record's hostname resolves back to the expected IP (the Forward-Confirmed Reverse DNS check).
{
"hostname": "dns.google",
"addresses": [
{ "type": "A", "address": "8.8.8.8", "ttl": 300 },
{ "type": "A", "address": "8.8.4.4", "ttl": 300 }
]
}
curl "https://ip-api.io/api/v1/dns/forward/dns.google" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
response = requests.get(
"https://ip-api.io/api/v1/dns/forward/dns.google",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = response.json()
for addr in data["addresses"]:
print(addr["type"], addr["address"])
const response = await fetch(
"https://ip-api.io/api/v1/dns/forward/dns.google",
{ headers: { Authorization: "Bearer YOUR_API_KEY" } }
);
const data = await response.json();
data.addresses.forEach(a =>
console.log(a.type, a.address)
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"https://ip-api.io/api/v1/dns/forward/dns.google");
curl_setopt($ch, CURLOPT_HTTPHEADER,
["Authorization: Bearer YOUR_API_KEY"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
foreach ($data["addresses"] as $addr) {
echo $addr["type"] . ": " . $addr["address"];
}
ip
string
The input IP address
hostname
string | null
The FQDN from the PTR record, or null if no PTR exists
ptr_record
string | null
The in-addr.arpa or ip6.arpa zone name queried
ttl
integer | null
Time-to-live of the PTR record in seconds
hostname
string
Input hostname (forward lookup response)
addresses[].type
string
"A" for IPv4 or "AAAA" for IPv6
addresses[].address
string
The resolved IP address
addresses[].ttl
integer
Time-to-live of the address record in seconds
Start using IP-API.io to make your website safer and more user-friendly. Keep out unwanted bots, show visitors content that's relevant to where they are, and spot risky IP addresses quickly. It's perfect for making online shopping more personal and keeping your site secure. Get started today with one of the plans!
A reverse DNS lookup (rDNS) is the process of resolving an IP address back to its associated hostname.
While normal DNS translates a domain name into an IP address, reverse DNS does the opposite — it queries
the in-addr.arpa (IPv4) or ip6.arpa (IPv6) DNS zone to find the PTR record
for an IP address. The result is the fully qualified domain name (FQDN) assigned to that IP by its owner.
A PTR (pointer) record is the DNS record type used exclusively for reverse lookups. It maps an IP address
to a hostname and lives in a special DNS zone: in-addr.arpa for IPv4 and ip6.arpa
for IPv6. For example, the PTR record for 8.8.8.8 lives at
8.8.8.8.in-addr.arpa and points to dns.google.
Unlike A records (which you set at your domain registrar), PTR records must be configured by the owner of the IP address block — your ISP or hosting provider.
Most receiving mail servers perform a Forward-Confirmed Reverse DNS (FCrDNS) check: they look up the PTR record for the sending IP address, then verify that the resulting hostname has an A record pointing back to the same IP. If the check fails — or if no PTR record exists at all — many servers reject the message outright or mark it as spam.
This is why any server used for sending email must have a properly configured PTR record that
matches its mail hostname (HELO/EHLO name).
PTR records are controlled by the owner of the IP address block, not by your domain registrar. Here is how to set one up:
After setting it up, use the tool above to verify the IP resolves to your hostname, then check the Hostname → IPs tab to confirm the hostname resolves back to the same IP.
An A record maps a hostname to an IP address (forward DNS). A PTR record maps an IP address to a hostname (reverse DNS). They point in opposite directions:
mail.example.com → 203.0.113.5 — managed at your domain registrar.203.0.113.5 → mail.example.com — managed by your ISP/hosting provider.For email deliverability, both should be consistent: the PTR for your sending IP should point to your mail hostname, and that hostname should have an A record pointing back to the same IP.
Many IP addresses have no PTR record configured. This is common for residential IPs assigned by consumer ISPs, cloud instances that have never had reverse DNS set up, and IP addresses from large DHCP pools. A missing PTR record does not necessarily mean the IP is malicious, but for any server sending email or running public-facing services, it is considered a misconfiguration.
To add a PTR record, contact your ISP or cloud provider — you cannot add it yourself unless you own the IP address block.
The interactive reverse DNS lookup tool on this page is completely free with no sign-up required. Programmatic API access for developers requires a paid subscription. The API endpoints are:
GET https://ip-api.io/api/v1/dns/reverse/{ip}GET https://ip-api.io/api/v1/dns/forward/{hostname}Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.
Contact SupportCustomize your experience with tailored plans that fit your IP security and geolocation needs.
Email Us