Reverse DNS (PTR) Lookup

Resolve Any IP to Its Hostname — or Any Hostname to Its IPs — Instantly

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.

Free — no account needed
Live DNS query results
JSON API for developers

Reverse DNS Lookup

Enter an IPv4 or IPv6 address to find its PTR record

What Is Reverse DNS?

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.

Forward DNS (A record)
mail.example.com 93.184.216.34
Reverse DNS (PTR record)
93.184.216.34 a.iana-servers.net

When Are PTR Records Required?

Email Deliverability (FCrDNS)

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.

Server Identification in Logs

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.

Spam and Fraud Detection

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.

How to Configure a PTR Record

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:

1
Cloud providers (AWS, GCP, Azure) — Each platform has a built-in option. On AWS EC2, go to Elastic IPs → Actions → Update reverse DNS. On GCP, edit the network interface and set a DNS PTR record field. On Azure, the public IP resource has a DNS name label setting.
2
Dedicated servers / VPS — Contact your hosting provider or ISP and request a PTR record for your IP. They need to know the IP address and the hostname it should point to (e.g., mail.example.com).
3
Verify the setup — After the PTR record is set, use the tool above to confirm the IP resolves to your hostname, then use the Hostname → IPs tab to confirm the hostname resolves back to the same IP (FCrDNS check).
FCrDNS Verification Checklist

A correct setup requires both checks to pass. Run these after your PTR record is configured:

Step 1 — Reverse lookup (IP → hostname)
$ dig -x 203.0.113.5 +short
mail.example.com.
The PTR record should return your mail hostname.
Step 2 — Forward lookup (hostname → IP)
$ dig mail.example.com A +short
203.0.113.5
The A record must resolve back to the same IP.
FCrDNS check passes — email deliverability verified

Reverse DNS API

Integrate reverse and forward DNS lookups into your application with a simple REST API. Returns JSON responses with PTR records, hostnames, and IP addresses.

GET 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.

Example Response

{
  "ip": "8.8.8.8",
  "hostname": "dns.google",
  "ptr_record": "8.8.8.8.in-addr.arpa",
  "ttl": 300
}

Code Examples

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
GET 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).

Example Response

{
  "hostname": "dns.google",
  "addresses": [
    { "type": "A", "address": "8.8.8.8", "ttl": 300 },
    { "type": "A", "address": "8.8.4.4", "ttl": 300 }
  ]
}

Code Examples

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"];
}

Response Fields

Field Type Description
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

Pricing

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!

Small

€10 /mo
100,000 geo ip requests
10,000 advanced email validation requests
Location data
Email validation
Risk score calculation
Currency data
Time zone data
Threat data
Unlimited support
HTTPS encryption

Medium

€20 /mo
300,000 geo ip requests
25,000 advanced email validation requests
Location data
Email validation
Risk score calculation
Currency data
Time zone data
Threat data
Unlimited support
HTTPS encryption
Note: Your API key will be sent to your email after the subscription is confirmed.

Frequently Asked Questions

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:

  • AWS EC2: Go to EC2 → Elastic IPs → Actions → Update reverse DNS.
  • Google Cloud: Edit the network interface for your instance and set the DNS PTR record field.
  • Azure: Edit the Public IP resource and set the DNS name label.
  • Dedicated servers / VPS: Contact your hosting provider or ISP and request a PTR record for your IP.

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:

  • A record: mail.example.com → 203.0.113.5 — managed at your domain registrar.
  • PTR record: 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:

  • PTR lookup: GET https://ip-api.io/api/v1/dns/reverse/{ip}
  • Forward lookup: GET https://ip-api.io/api/v1/dns/forward/{hostname}

Need support?

Explore how IP-API.io can enhance your security, provide robust bot protection, and improve IP geolocation accuracy for your applications.

Contact Support

Need more queries?

Customize your experience with tailored plans that fit your IP security and geolocation needs.

Email Us