Function: nslookup-host

nslookup-host is an autoloaded, interactive and byte-compiled function defined in net-utils.el.gz.

Signature

(nslookup-host HOST &optional NAME-SERVER)

Documentation

Look up the DNS information for HOST (name or IP address).

Optional argument NAME-SERVER says which server to use for DNS resolution. Interactively, prompt for NAME-SERVER if invoked with prefix argument.

This command uses nslookup-program for looking up the DNS information.

See also: nslookup-host-ipv4, nslookup-host-ipv6 for non-interactive versions of this function more suitable for use in Lisp code.

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/net-utils.el.gz
;; FIXME -- Needs to be a process filter
;; (defun netstat-with-filter (filter)
;;   "Run netstat program."
;;   (interactive "sFilter: ")
;;   (netstat)
;;   (set-buffer (get-buffer "*Netstat*"))
;;   (goto-char (point-min))
;;   (delete-matching-lines filter))

;;;###autoload
(defun nslookup-host (host &optional name-server)
  "Look up the DNS information for HOST (name or IP address).
Optional argument NAME-SERVER says which server to use for
DNS resolution.
Interactively, prompt for NAME-SERVER if invoked with prefix argument.

This command uses `nslookup-program' for looking up the DNS information.

See also: `nslookup-host-ipv4', `nslookup-host-ipv6' for
non-interactive versions of this function more suitable for use
in Lisp code."
  (interactive
   (list (read-from-minibuffer "Lookup host: " (net-utils-machine-at-point))
         (if current-prefix-arg (read-from-minibuffer "Name server: "))))
  (let ((options
         (append nslookup-program-options (list host)
                 (if name-server (list name-server)))))
    (net-utils-run-program
     "Nslookup"
     (concat "** "
      (mapconcat #'identity
		(list "Nslookup" host nslookup-program)
		" ** "))
     nslookup-program
     options)))