(query-dns): Resolve reverse addresses.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 9 Nov 2004 22:49:38 +0000 (22:49 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 9 Nov 2004 22:49:38 +0000 (22:49 +0000)
lisp/ChangeLog
lisp/dns.el

index 1fb1f52..92562c6 100644 (file)
@@ -1,3 +1,13 @@
+2004-11-09  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * dns.el (query-dns): Resolve reverse addresses.
+
+2004-10-23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-group.el (gnus-group-get-new-news): Use it.
+
+       * gnus-start.el (gnus-check-reasonable-setup): New function.
+
 2004-11-07  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-msg.el (gnus-configure-posting-styles): Don't cause the
index 0bab5d6..8b84e17 100644 (file)
@@ -348,13 +348,20 @@ If TCP-P, the first two bytes of the package with be the length field."
         ;; connection to the DNS server.
         (open-network-stream "dns" (current-buffer) server "domain")))))
 
-(defun query-dns (name &optional type fullp)
+(defun query-dns (name &optional type fullp reversep)
   "Query a DNS server for NAME of TYPE.
-If FULLP, return the entire record returned."
+If FULLP, return the entire record returned.
+If REVERSEP, look up an IP address."
   (setq type (or type 'A))
   (unless dns-servers
     (dns-parse-resolv-conf))
 
+  (when reversep
+    (setq name (concat
+               (mapconcat 'identity (nreverse (split-string name "\\.")) ".")
+               ".in-addr.arpa")
+         type 'PTR))
+
   (if (not dns-servers)
       (message "No DNS server configuration found")
     (mm-with-unibyte-buffer