Commit ac8a1898 authored by Peter Breton's avatar Peter Breton
Browse files

Add dns-lookup-program wrapper

parent 0648dde0
2003-03-23 Peter Breton <pbreton@attbi.com>
* net/net-utils.el (dns-lookup-host): New function.
2003-03-23 Martin Stjernholm <bug-cc-mode@gnu.org> 2003-03-23 Martin Stjernholm <bug-cc-mode@gnu.org>
   
* progmodes/cc-mode.el (c-parse-state): Added kludge to avoid * progmodes/cc-mode.el (c-parse-state): Added kludge to avoid
......
...@@ -205,6 +205,18 @@ This variable is only used if the variable ...@@ -205,6 +205,18 @@ This variable is only used if the variable
:group 'net-utils :group 'net-utils
:type 'regexp) :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 ;; Internal variables
(defvar network-connection-service nil) (defvar network-connection-service nil)
(defvar network-connection-host nil) (defvar network-connection-host nil)
...@@ -428,6 +440,25 @@ If your system's ping continues until interrupted, you can try setting ...@@ -428,6 +440,25 @@ If your system's ping continues until interrupted, you can try setting
(define-key nslookup-mode-map "\t" 'comint-dynamic-complete) (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 ;;;###autoload
(defun dig (host) (defun dig (host)
"Run dig program." "Run dig program."
...@@ -622,10 +653,11 @@ queries of the form USER@HOST, and wants a query containing USER only." ...@@ -622,10 +653,11 @@ queries of the form USER@HOST, and wants a query containing USER only."
(process-name (concat "Finger [" user-and-host "]")) (process-name (concat "Finger [" user-and-host "]"))
(regexps finger-X.500-host-regexps) (regexps finger-X.500-host-regexps)
found) found)
(while (and regexps (not (string-match (car regexps) host))) (and regexps
(setq regexps (cdr regexps))) (while (not (string-match (car regexps) host))
(when regexps (setq regexps (cdr regexps)))
(setq user-and-host user)) (when regexps
(setq user-and-host user)))
(run-network-program (run-network-program
process-name process-name
host host
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment