aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPeter Breton2003-03-23 13:39:14 +0000
committerPeter Breton2003-03-23 13:39:14 +0000
commitac8a189856cf2b2e376f9f07b39f8b7828e06cb9 (patch)
tree916cf48f8f01e82e013ce101254688265789a60d /lisp
parent0648dde0da60856aa02b78078ae7e380aba02e39 (diff)
downloademacs-ac8a189856cf2b2e376f9f07b39f8b7828e06cb9.tar.gz
emacs-ac8a189856cf2b2e376f9f07b39f8b7828e06cb9.zip
Add dns-lookup-program wrapper
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/net/net-utils.el40
2 files changed, 40 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4f42a72dba1..4b2d88f152e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12003-03-23 Peter Breton <pbreton@attbi.com>
2
3 * net/net-utils.el (dns-lookup-host): New function.
4
12003-03-23 Martin Stjernholm <bug-cc-mode@gnu.org> 52003-03-23 Martin Stjernholm <bug-cc-mode@gnu.org>
2 6
3 * progmodes/cc-mode.el (c-parse-state): Added kludge to avoid 7 * progmodes/cc-mode.el (c-parse-state): Added kludge to avoid
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
205 :group 'net-utils 205 :group 'net-utils
206 :type 'regexp) 206 :type 'regexp)
207 207
208(defcustom dns-lookup-program "host"
209 "Program to interactively query DNS information."
210 :group 'net-utils
211 :type 'string
212 )
213
214(defcustom dns-lookup-program-options nil
215 "List of options to pass to the dns-lookup program."
216 :group 'net-utils
217 :type '(repeat string)
218 )
219
208;; Internal variables 220;; Internal variables
209(defvar network-connection-service nil) 221(defvar network-connection-service nil)
210(defvar network-connection-host nil) 222(defvar network-connection-host nil)
@@ -429,6 +441,25 @@ If your system's ping continues until interrupted, you can try setting
429(define-key nslookup-mode-map "\t" 'comint-dynamic-complete) 441(define-key nslookup-mode-map "\t" 'comint-dynamic-complete)
430 442
431;;;###autoload 443;;;###autoload
444(defun dns-lookup-host (host)
445 "Lookup the DNS information for HOST (name or IP address)."
446 (interactive
447 (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))))
448 (let ((options
449 (if dns-lookup-program-options
450 (append dns-lookup-program-options (list host))
451 (list host))))
452 (net-utils-run-program
453 (concat "DNS Lookup [" host "]")
454 (concat "** "
455 (mapconcat 'identity
456 (list "DNS Lookup" host dns-lookup-program)
457 " ** "))
458 dns-lookup-program
459 options
460 )))
461
462;;;###autoload
432(defun dig (host) 463(defun dig (host)
433 "Run dig program." 464 "Run dig program."
434 (interactive 465 (interactive
@@ -622,10 +653,11 @@ queries of the form USER@HOST, and wants a query containing USER only."
622 (process-name (concat "Finger [" user-and-host "]")) 653 (process-name (concat "Finger [" user-and-host "]"))
623 (regexps finger-X.500-host-regexps) 654 (regexps finger-X.500-host-regexps)
624 found) 655 found)
625 (while (and regexps (not (string-match (car regexps) host))) 656 (and regexps
626 (setq regexps (cdr regexps))) 657 (while (not (string-match (car regexps) host))
627 (when regexps 658 (setq regexps (cdr regexps)))
628 (setq user-and-host user)) 659 (when regexps
660 (setq user-and-host user)))
629 (run-network-program 661 (run-network-program
630 process-name 662 process-name
631 host 663 host