diff options
author | Vincent Ambo <tazjin@google.com> | 2020-01-26T21·06+0000 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-01-26T21·06+0000 |
commit | 24c2fc8ae1e5c0e2088dbcd0b7ea2d481d85d474 (patch) | |
tree | bed638c2dd48f2df2a2227acb0e8c56bcedb3f5b /lisp/dns/resolver.lisp | |
parent | a2d0b7f3998dded968074da1c282361d512d75a0 (diff) | |
parent | 3f9546197e11357ec7c62d225ed2d1820a22ce2f (diff) |
Merge branch 'feat/dns-lisp' r/459
Diffstat (limited to 'lisp/dns/resolver.lisp')
-rw-r--r-- | lisp/dns/resolver.lisp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lisp/dns/resolver.lisp b/lisp/dns/resolver.lisp deleted file mode 100644 index 774be525cb20..000000000000 --- a/lisp/dns/resolver.lisp +++ /dev/null @@ -1,29 +0,0 @@ -;; Initial implementation is a simple client for -;; https://developers.google.com/speed/public-dns/docs/doh/json - -(defpackage #:dns - (:documentation "Simple DNS resolver in Common Lisp") - (:use #:cl) - (:export #:lookup-txt #:lookup-mx)) - -(defvar *doh-base-url* "https://dns.google/resolve" - "Base URL of the service providing DNS-over-HTTP(S). Defaults to the - Google-hosted API.") - -(defun lookup-generic (name type) - (multiple-value-bind (body) - (drakma:http-request *doh-base-url* - :decode-content t - :want-stream t - :parameters `(("type" . ,type) - ("name" . ,name) - ("ct" . "application/x-javascript"))) - (cl-json:decode-json body))) - -(defun lookup-txt (name) - "Look up the TXT records at NAME." - (lookup-generic name "TXT")) - -(defun lookup-mx (name) - "Look up the MX records at NAME." - (lookup-generic name "MX")) |