--- dns.tcl.orig	Thu Jun 13 12:34:10 2019
+++ dns.tcl	Thu Jun 13 12:38:02 2019
@@ -286,10 +286,17 @@
         }
     }
 
-    # Check for reverse lookups
+    # Check for reverse lookups, IPv4 first, then IPv6
     if {[regexp {^(?:\d{0,3}\.){3}\d{0,3}$} $state(query)]} {
         set addr [lreverse [split $state(query) .]]
         lappend addr in-addr arpa
+        set state(query) [join $addr .]
+        set state(-type) PTR
+    } elseif {[string match {*:*} $state(query)]} {
+        set addr [ip::normalize $state(query)]
+        set addr [split [string reverse $addr] :]
+        set addr [join [split [join $addr ""] {}] .]
+        lappend addr ip6 arpa
         set state(query) [join $addr .]
         set state(-type) PTR
     }
