7

Consider the following run of the dig command, where I simply query for the IP address of google.com:

$ dig google.com

; <<>> DiG 9.16.1-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32427
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             276     IN      A       142.250.71.14

;; Query time: 1437 msec
;; SERVER: 192.168.225.1#53(192.168.225.1)
;; WHEN: Sun May 15 23:49:53 IST 2022
;; MSG SIZE  rcvd: 55

The response says that 142.250.71.14 is the IP. Now, if I were to run a reverse DNS lookup with the same IP, such as:

$ dig -x 142.250.71.14

; <<>> DiG 9.16.1-Ubuntu <<>> -x 142.250.71.14
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61497
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;14.71.250.142.in-addr.arpa.    IN      PTR

;; ANSWER SECTION:
14.71.250.142.in-addr.arpa. 67394 IN    PTR     maa03s34-in-f14.1e100.net.

;; Query time: 15 msec
;; SERVER: 192.168.225.1#53(192.168.225.1)
;; WHEN: Sun May 15 23:52:46 IST 2022
;; MSG SIZE  rcvd: 83

The response says that the IP points to maa03s34-in-f14.1e100.net (and not google.com). How can this difference be explained?

1
  • 3
    Perhaps it helps to keep in mind the general architecture of the web: A single domain name can be served by many hosts (load balancing). A single host can serve many domain names (virtual hosting, possible on many protocols). A one-to-one mapping is not possible anyway so why bother.
    – Daniel B
    May 16, 2022 at 6:42

1 Answer 1

12

Forward and reverse DNS have almost nothing in common.

Reverse DNS is treated like forward DNS, except for using a special zone (in-addr.arpa), which can then be delegated and subdelegated. This happens entirely independently of forward DNS.

Again, for the sake of clarity, when a forward DNS entry is made, there no reverse entry can be automatically generated within DNS (it can, of-course, be programmed where the DNS server has access to the appropriate part of the reverse zone, but its not automatic, and indeed not even common).

(Another way to look at why this doesn't matter is that many, many domains use a common IP address, and many domains use more then 1 IP address - so there can be no 1:1 mapping).

1
  • Agreed, forward and reverse DNS entries are completely unrelated (and either of them need not exist). Although, in some situations (like DNS entries for mail servers) it is a good practice to make them correspond, which is then called FCrDNS May 16, 2022 at 15:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .