反向 DNS 如何工作?

反向 DNS 如何工作?

我读了很多,但还是不明白。例如,我们有 example.com、127.0.0.1 和 1.0.0.127.in-addr.arpa

正向 DNS 很简单。example.com 指向 127.0.0.1

1.0.0.127.in-addr.arpa 是什么以及 127.0.0.1 如何指向它?

而且这个 1.0.0.127.in-addr.arpa 是否也应该以某种方式指向 example.com,或者这一切都是由 DNS 服务器上的 PTR 记录完成的?

答案1

与 DNS 服务器对于域区域 (*.example.com) 具有“权威性”类似,DNS 服务器将负责解析反向 DNS 区域:您将拥有 PTR 记录,而不是 A 记录。

反向查找的过程几乎与正向查找完全相同,但它使用 IP 而不是 FQDN:

反向 DNS 查找如何完成:

* The DNS resolver reverses the IP, and adds it to ".inaddr.arpa" (or ".ip6.arpa" for IPv6 lookups), turning 192.0.2.25 into 25.2.0.192.inaddr.arpa.
* The DNS resolver then looks up the PTR record for 25.2.0.192.inaddr.arpa.
      - The DNS resolver asks the root servers for the PTR record for 25.2.0.192.inaddr.arpa.
      - The root servers refer the DNS resolver to the DNS servers in charge of the Class A range (192.inaddr.arpa, which covers all IPs that begin with 192).
      - In almost all cases, the root servers will refer the DNS resolver to a "RIR" ("Regional Internet Registry"). These are the organizations that allocate IPs. In general, ARIN handles North American IPs, APNIC handles AsianPacific IPs, and RIPE handles European IPs.
      - The DNS resolver will ask the ARIN DNS servers for the PTR record for 25.2.0.192.inaddr.arpa.
      - The ARIN DNS servers will refer the DNS resolver to the DNS servers of the organization that was originally given the IP range. These are usually the DNS servers of your ISP, or their bandwidth provider.
      - The DNS resolver will ask the ISP's DNS servers for the PTR record for 25.2.0.192.inaddr.arpa.
      - The ISP's DNS servers will refer the DNS resolver to the organization's DNS servers.
      - The DNS resolver will ask the organization's DNS servers for the PTR record for 25.2.0.192.inaddr.arpa.
      - The organization's DNS servers will respond with "host.example.com". 

参考: http://www.dnsstuff.com/reverse-dns-faq/

相关内容