summaryrefslogtreecommitdiff
path: root/lisp/net/net-utils.el
diff options
context:
space:
mode:
authorPeter Breton <pbreton@attbi.com>2003-03-23 13:39:14 +0000
committerPeter Breton <pbreton@attbi.com>2003-03-23 13:39:14 +0000
commitac8a189856cf2b2e376f9f07b39f8b7828e06cb9 (patch)
tree916cf48f8f01e82e013ce101254688265789a60d /lisp/net/net-utils.el
parent0648dde0da60856aa02b78078ae7e380aba02e39 (diff)
downloademacs-ac8a189856cf2b2e376f9f07b39f8b7828e06cb9.tar.gz
Add dns-lookup-program wrapper
Diffstat (limited to 'lisp/net/net-utils.el')
-rw-r--r--lisp/net/net-utils.el40
1 files changed, 36 insertions, 4 deletions
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el
index baff8283928..982923ed559 100644
--- a/lisp/net/net-utils.el
+++ b/lisp/net/net-utils.el
@@ -205,6 +205,18 @@ This variable is only used if the variable
:group 'net-utils
:type 'regexp)
+(defcustom dns-lookup-program "host"
+ "Program to interactively query DNS information."
+ :group 'net-utils
+ :type 'string
+ )
+
+(defcustom dns-lookup-program-options nil
+ "List of options to pass to the dns-lookup program."
+ :group 'net-utils
+ :type '(repeat string)
+ )
+
;; Internal variables
(defvar network-connection-service nil)
(defvar network-connection-host nil)
@@ -429,6 +441,25 @@ If your system's ping continues until interrupted, you can try setting
(define-key nslookup-mode-map "\t" 'comint-dynamic-complete)
;;;###autoload
+(defun dns-lookup-host (host)
+ "Lookup the DNS information for HOST (name or IP address)."
+ (interactive
+ (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))))
+ (let ((options
+ (if dns-lookup-program-options
+ (append dns-lookup-program-options (list host))
+ (list host))))
+ (net-utils-run-program
+ (concat "DNS Lookup [" host "]")
+ (concat "** "
+ (mapconcat 'identity
+ (list "DNS Lookup" host dns-lookup-program)
+ " ** "))
+ dns-lookup-program
+ options
+ )))
+
+;;;###autoload
(defun dig (host)
"Run dig program."
(interactive
@@ -622,10 +653,11 @@ queries of the form USER@HOST, and wants a query containing USER only."
(process-name (concat "Finger [" user-and-host "]"))
(regexps finger-X.500-host-regexps)
found)
- (while (and regexps (not (string-match (car regexps) host)))
- (setq regexps (cdr regexps)))
- (when regexps
- (setq user-and-host user))
+ (and regexps
+ (while (not (string-match (car regexps) host))
+ (setq regexps (cdr regexps)))
+ (when regexps
+ (setq user-and-host user)))
(run-network-program
process-name
host