Function: dig-invoke

dig-invoke is a byte-compiled function defined in dig.el.gz.

Signature

(dig-invoke DOMAIN &optional QUERY-TYPE QUERY-CLASS QUERY-OPTION DIG-OPTION SERVER)

Documentation

Call dig with given arguments and return buffer containing output.

DOMAIN is a string with a DNS domain. QUERY-TYPE is an optional string with a DNS type. QUERY-CLASS is an optional string with a DNS class. QUERY-OPTION is an optional string with dig "query options". DIG-OPTION is an optional string with parameters for the dig program. SERVER is an optional string with a domain name server to query.

Dig is an external program found in the BIND name server distribution, and is a commonly available debugging tool.

Source Code

;; Defined in /usr/src/emacs/lisp/net/dig.el.gz
(defun dig-invoke (domain &optional
                       query-type query-class query-option
                       dig-option server)
  "Call dig with given arguments and return buffer containing output.
DOMAIN is a string with a DNS domain.  QUERY-TYPE is an optional
string with a DNS type.  QUERY-CLASS is an optional string with a DNS
class.  QUERY-OPTION is an optional string with dig \"query options\".
DIG-OPTION is an optional string with parameters for the dig program.
SERVER is an optional string with a domain name server to query.

Dig is an external program found in the BIND name server distribution,
and is a commonly available debugging tool."
  (let (buf cmdline)
    (setq buf (generate-new-buffer "*dig output*"))
    (if dig-option (push dig-option cmdline))
    (if query-option (push query-option cmdline))
    (if query-class (push query-class cmdline))
    (if query-type (push query-type cmdline))
    (push domain cmdline)
    (if server (push (concat "@" server) cmdline)
      (if dig-dns-server (push (concat "@" dig-dns-server) cmdline)))
    (apply #'call-process dig-program nil buf nil
           (append dig-program-options cmdline))
    buf))