Forward and Reverse DNS Lookup Explained (With Examples)

1. Forward Lookup (Name → IP)

Definition

Forward Lookup resolves a domain name (e.g., google.com) to an IP address (e.g., 142.250.190.46).

Purpose

  • Enables browsers, apps, and services to locate servers using human-readable names.
  • Essential for web browsing, email delivery (MX records), and CDN routing.

Key Components

A (Address) Record

example.com.    A    93.184.216.34

AAAA Record (IPv6)

example.com.    AAAA    2606:2800:220:1:248:1893:25c8:1946

How DNS Resolver Works in Forward Lookup

  1. You type example.com in the browser → OS checks local DNS cache.
  2. If not cached → The recursive resolver (e.g., 8.8.8.8) sends queries to:
    • Root DNS server → TLD (.com) server → Authoritative DNS server
  3. Response: IP address is returned (e.g., 93.184.216.34)

DNS Server Roles

TypeResponsibility
AuthoritativeHolds the actual DNS records (e.g., ns1.example.com)
RecursiveCaches responses (e.g., Google DNS 8.8.8.8)

Tools to Test Forward Lookup

nslookup example.com
dig example.com
host example.com

Common Issues in Forward Lookup

  • ❌ Misconfigured A record → Website unreachable
  • ❌ Expired TTL with stale cache → Delayed updates
  • ❌ DNS server unresponsive → Use dig +trace to debug

2. Reverse Lookup (IP → Name)

Definition

Reverse Lookup resolves an IP address (e.g., 8.8.8.8) to a domain name (e.g., dns.google).

Purpose

  • Security: Spam filters verify sender IPs
  • Logging: Syslogs show domain names instead of raw IPs
  • Troubleshooting: Identify unknown IPs

PTR (Pointer) Record

34.216.184.93.in-addr.arpa.    PTR    example.com.

How Reverse Lookup Works

  1. Query for 8.8.8.8
  2. DNS resolver checks reverse zone 8.8.8.in-addr.arpa
  3. Authoritative server returns PTR record → e.g., dns.google

Reverse Lookup Zone (in-addr.arpa)

Example for 192.168.1.0/241.168.192.in-addr.arpa

IPv6 reverse zone: .ip6.arpa

Tools to Test Reverse Lookup

nslookup 8.8.8.8
dig -x 142.250.190.46

Relationship Between A and PTR Records

Forward: example.com → 93.184.216.34 (A record)
Reverse: 34.216.184.93.in-addr.arpa → example.com (PTR record)

🔒 Best Practice: Ensure A and PTR match to avoid email delivery issues.

Summary Table: Forward vs. Reverse Lookup

FeatureForward LookupReverse Lookup
PurposeResolves domain → IPResolves IP → domain
Record TypeA, AAAAPTR
Zone TypeForward Lookup Zonein-addr.arpa
Examplegoogle.com → 8.8.8.88.8.8.8 → dns.google
Toolsnslookup, dignslookup, dig -x

Practical Examples

$ dig google.com
;; ANSWER SECTION:
google.com. 300 IN A 142.250.190.46
$ dig -x 142.250.190.46
;; ANSWER SECTION:
46.190.250.142.in-addr.arpa. 3600 IN PTR lhr25s29-in-f14.1e100.net.

Key Takeaways

  • ✅ Forward Lookup = Name → IP (uses A/AAAA records)
  • ✅ Reverse Lookup = IP → Name (uses PTR in .arpa zones)
  • ✅ Important for web browsing, email delivery, and security
  • ✅ Use tools like nslookup, dig, host for DNS testing

Forward and Reverse DNS Lookup Quiz

1. What is the purpose of Forward DNS Lookup?

Correct answer is B. Forward Lookup resolves domain names to IP addresses to help locate servers.

2. Which DNS record type maps a domain to an IPv4 address?

Correct answer is C. A records map domains to IPv4 addresses.

3. What is the role of the Recursive DNS Resolver?

Correct answer is B. Recursive resolvers fetch DNS data by querying multiple servers step-by-step.

4. What is the purpose of Reverse DNS Lookup?

Correct answer is B. Reverse Lookup resolves IP addresses back to domain names for verification and logging.

5. Which DNS record type is used in Reverse Lookup?

Correct answer is B. PTR records map IP addresses to domain names.

6. What is the typical zone used in Reverse DNS Lookup for IPv4?

Correct answer is A. Reverse DNS zones for IPv4 use the in-addr.arpa domain.

7. Which tool can perform detailed DNS lookups?

Correct answer is B. The dig tool performs detailed DNS queries.

8. What happens when DNS responses include a TTL (Time To Live)?

Correct answer is B. TTL instructs resolvers how long to cache DNS data.

9. What is a common issue caused by missing PTR records?

Correct answer is A. Missing PTR records often cause emails to be flagged as spam.

10. What is the relationship between A records and PTR records?

Correct answer is C. A records map domains to IPs, PTR records map IPs back to domains.

← Back to Home