205 |
:group 'net-utils |
:group 'net-utils |
206 |
:type 'regexp) |
:type 'regexp) |
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 |
|
|
220 |
;; Internal variables |
;; Internal variables |
221 |
(defvar network-connection-service nil) |
(defvar network-connection-service nil) |
222 |
(defvar network-connection-host nil) |
(defvar network-connection-host nil) |
441 |
(define-key nslookup-mode-map "\t" 'comint-dynamic-complete) |
(define-key nslookup-mode-map "\t" 'comint-dynamic-complete) |
442 |
|
|
443 |
;;;###autoload |
;;;###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 |
463 |
(defun dig (host) |
(defun dig (host) |
464 |
"Run dig program." |
"Run dig program." |
465 |
(interactive |
(interactive |
653 |
(process-name (concat "Finger [" user-and-host "]")) |
(process-name (concat "Finger [" user-and-host "]")) |
654 |
(regexps finger-X.500-host-regexps) |
(regexps finger-X.500-host-regexps) |
655 |
found) |
found) |
656 |
(while (and regexps (not (string-match (car regexps) host))) |
(and regexps |
657 |
(setq regexps (cdr regexps))) |
(while (not (string-match (car regexps) host)) |
658 |
(when regexps |
(setq regexps (cdr regexps))) |
659 |
(setq user-and-host user)) |
(when regexps |
660 |
|
(setq user-and-host user))) |
661 |
(run-network-program |
(run-network-program |
662 |
process-name |
process-name |
663 |
host |
host |