Search This Blog

Sunday, November 18, 2018

How to discover the rDNS of an IPv6

To discover the rDNS of an IPv4, just consult the PTR of the IP reverse form with “.ip6.arpa”. As an example, the IP “2607:f8b0:400c:c05::22f” is transformed into “f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa” and the PTR record is query:


# dig PTR f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa +noall +answer

; <<>> DiG 9.11.3-RedHat-9.11.3-6.fc28 <<>> PTR f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa +noall +answer
;; global options: +cmd
f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa. 21599 IN PTR mail-vk0-x22f.google.com.
[root@d2a123d026ab /]# dig -x 2607:f8b0:400c:c05::22f

; <<>> DiG 9.11.3-RedHat-9.11.3-6.fc28 <<>> -x 2607:f8b0:400c:c05::22f
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12750
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa. IN PTR

;; ANSWER SECTION:
f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa. 21599 IN PTR mail-vk0-x22f.google.com.

;; Query time: 853 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Jun 13 14:26:28 UTC 2018
;; MSG SIZE  rcvd: 139

[root@d2a123d026ab /]# dig AAAA mail-vk0-x22f.google.com +noall +answer

; <<>> DiG 9.11.3-RedHat-9.11.3-6.fc28 <<>> AAAA mail-vk0-x22f.google.com +noall +answer
;; global options: +cmd
mail-vk0-x22f.google.com. 21599 IN AAAA 2607:f8b0:400c:c05::22f

# dig -x 2607:f8b0:400c:c05::22f

; <<>> DiG 9.11.3-RedHat-9.11.3-6.fc28 <<>> -x 2607:f8b0:400c:c05::22f
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59208
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa. IN PTR

;; ANSWER SECTION:
f.2.2.0.0.0.0.0.0.0.0.0.0.0.0.0.5.0.c.0.c.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa. 21599 IN PTR mail-vk0-x22f.google.com.

;; Query time: 48 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Wed Jun 13 13:00:13 UTC 2018
;; MSG SIZE  rcvd: 139