;;; dig.el --- Domain Name System dig interface
-;; Copyright (c) 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (c) 2000, 2001, 2003 Free Software Foundation, Inc.
;; Author: Simon Josefsson <simon@josefsson.org>
;; Keywords: DNS BIND dig
-;; This file is not a part of GNU Emacs, but the same permissions apply.
+;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published
;; named for consistency with query-dns in dns.el
(defun query-dig (domain &optional
- query-type query-class query-option dig-option server)
- "Query addresses of a DOMAIN using dig, by calling `dig-invoke' and `dig-extract-rr'.
-Optional arguments are passed to `dig-invoke' and `dig-extract-rr'. Returns nil for a nonexistent domain."
-(let ((buffer (dig-invoke domain query-type query-class query-option dig-option server)))
+ query-type query-class query-option dig-option server)
+ "Query addresses of a DOMAIN using dig.
+It works by calling `dig-invoke' and `dig-extract-rr'. Optional
+arguments are passed to `dig-invoke' and `dig-extract-rr'. Returns
+nil for domain/class/type queries that results in no data."
+(let ((buffer (dig-invoke domain query-type query-class
+ query-option dig-option server)))
(when buffer
- (switch-to-buffer buffer)
- (setq digger (dig-extract-rr domain query-type query-class))
+ (switch-to-buffer buffer)
+ (let ((digger (dig-extract-rr domain query-type query-class)))
(kill-buffer buffer)
- digger)))
+ digger))))
(provide 'dig)