Repository: kpcyrd/sn0int (language: rust)

Issue:
Custom nameserver option in dns function
The `dns` function needs to be changed to support talking to a specific nameserver.

This is needed for AXFR lookups.


Discussion / hints:
This is implemented, but currently blocked by https://github.com/bluejekyll/trust-dns/issues/631

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 0b100cec..fb4993c3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -35,7 +35,7 @@ dependencies = [
 
 [[package]]
 name = "arrayvec"
-version = "0.4.7"
+version = "0.4.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -119,7 +119,7 @@ name = "blake2-rfc"
 version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -201,9 +201,19 @@ name = "cfg-if"
 version = "0.1.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "chrono"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "chrootable-https"
-version = "0.3.4"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -212,14 +222,16 @@ dependencies = [
  "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
  "http 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "hyper 0.12.16 (registry+https://github.com/rust-lang/crates.io-index)",
- "hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper-rustls 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ipconfig 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "resolv-conf 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_derive 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "trust-dns 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "trust-dns-proto 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "trust-dns-resolver 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -329,7 +341,7 @@ name = "crossbeam-epoch"
 version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -343,7 +355,7 @@ name = "crossbeam-epoch"
 version = "0.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "crossbeam-utils 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -402,7 +414,7 @@ dependencies = [
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -451,6 +463,31 @@ dependencies = [
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "data-encoding"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "data-encoding-macro"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "data-encoding-macro-internal 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "data-encoding-macro-internal"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "der-parser"
 version = "1.1.0"
@@ -544,19 +581,24 @@ dependencies = [
 
 [[package]]
 name = "encoding_rs"
-version = "0.8.12"
+version = "0.8.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "endian-type"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "env_logger"
 version = "0.6.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -613,7 +655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
  "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -624,7 +666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -780,7 +822,7 @@ dependencies = [
  "markup5ever 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -800,7 +842,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "humantime"
-version = "1.1.1"
+version = "1.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -868,6 +910,23 @@ dependencies = [
  "webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "hyper-rustls"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "ct-logs 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
+ "http 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hyper 0.12.16 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-rustls 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki-roots 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "hyper-tls"
 version = "0.3.1"
@@ -906,7 +965,7 @@ dependencies = [
 
 [[package]]
 name = "ipconfig"
-version = "0.1.7"
+version = "0.1.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "error-chain 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -923,7 +982,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -1007,11 +1066,6 @@ dependencies = [
  "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "linked-hash-map"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
 [[package]]
 name = "lock_api"
 version = "0.1.5"
@@ -1037,14 +1091,6 @@ dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "lru-cache"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "lua52-sys"
 version = "0.1.2"
@@ -1208,7 +1254,7 @@ dependencies = [
  "schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1229,6 +1275,11 @@ dependencies = [
  "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "nibble_vec"
+version = "0.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "nix"
 version = "0.11.0"
@@ -1462,6 +1513,19 @@ name = "precomputed-hash"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "proc-macro-hack"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "proc-macro-hack-impl"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
 [[package]]
 name = "proc-macro2"
 version = "0.3.8"
@@ -1531,6 +1595,15 @@ dependencies = [
  "scheduled-thread-pool 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "radix_trie"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "endian-type 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "nibble_vec 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "rand"
 version = "0.3.22"
@@ -1565,7 +1638,7 @@ dependencies = [
 
 [[package]]
 name = "rand"
-version = "0.6.0"
+version = "0.6.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1574,7 +1647,7 @@ dependencies = [
  "rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_isaac 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1613,7 +1686,7 @@ dependencies = [
 
 [[package]]
 name = "rand_isaac"
-version = "0.1.0"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1657,7 +1730,7 @@ dependencies = [
 
 [[package]]
 name = "redox_syscall"
-version = "0.1.42"
+version = "0.1.43"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
@@ -1665,7 +1738,7 @@ name = "redox_termios"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1676,7 +1749,7 @@ dependencies = [
  "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -1734,7 +1807,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "encoding_rs 0.8.12 (registry+https://github.com/rust-lang/crates.io-index)",
+ "encoding_rs 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
  "http 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
  "hyper 0.12.16 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1884,6 +1957,19 @@ dependencies = [
  "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "rustls"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "sct 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "rustyline"
 version = "2.1.0"
@@ -2032,7 +2118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -2110,7 +2196,7 @@ dependencies = [
  "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "boxxy 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "caps 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "chrootable-https 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "chrootable-https 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "crossbeam-channel 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2132,7 +2218,7 @@ dependencies = [
  "opener 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "pledge 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "publicsuffix 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "regex 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustyline 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "separator 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2148,7 +2234,6 @@ dependencies = [
  "tar 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
  "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "trust-dns-proto 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "unveil 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "x509-parser 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2198,7 +2283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2270,7 +2355,7 @@ dependencies = [
  "heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -2310,7 +2395,7 @@ dependencies = [
 
 [[package]]
 name = "syn"
-version = "0.15.21"
+version = "0.15.22"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2333,7 +2418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
  "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
+ "syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2354,19 +2439,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "xattr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "tempfile"
-version = "3.0.4"
+version = "3.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -2395,7 +2480,7 @@ version = "1.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2434,7 +2519,7 @@ version = "0.1.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.2.44 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
+ "redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2552,6 +2637,16 @@ dependencies = [
  "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "tokio-rustls"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "webpki 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "tokio-tcp"
 version = "0.1.2"
@@ -2575,7 +2670,7 @@ dependencies = [
  "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "tokio-executor 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -2634,12 +2729,32 @@ name = "traitobject"
 version = "0.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "trust-dns"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "data-encoding-macro 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "radix_trie 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
+ "tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "trust-dns-proto 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "trust-dns-proto"
 version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
  "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2657,24 +2772,6 @@ dependencies = [
  "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
-[[package]]
-name = "trust-dns-resolver"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
- "ipconfig 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "resolv-conf 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "smallvec 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "trust-dns-proto 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
 [[package]]
 name = "try-lock"
 version = "0.2.2"
@@ -2959,7 +3056,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
 "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5"
 "checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
-"checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
+"checksum arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f405cc4c21cd8b784f6c8fc2adf9bc00f59558f0049b5ec21517f875963040cc"
 "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
 "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
 "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
@@ -2978,7 +3075,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum caps 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c71a98c48851ab3763bf766c4a5129e66a9b355f7ff1e93a68e725bbcd05221"
 "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
 "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
-"checksum chrootable-https 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d067823088adb8217307cbf95265700c8e36de59a5aa991abe781e255f1ba9cd"
+"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878"
+"checksum chrootable-https 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b313cef6d3868d684b1d569d7f649d25bf9a42a5185e1bd946d0f71af2a43355"
 "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
 "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
 "checksum colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc0a60679001b62fb628c4da80e574b9645ab4646056d7c9018885efffe45533"
@@ -3001,6 +3099,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "630391922b1b893692c6334369ff528dcc3a9d8061ccf4c803aa8f83cb13db5e"
 "checksum curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c7c9d851c825e0c033979d4516c9173bc19a78a96eb4d6ae51d4045440eafa16"
 "checksum curl-sys 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)" = "721c204978be2143fab0a84b708c49d79d1f6100b8785610f456043a90708870"
+"checksum data-encoding 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67df0571a74bf0d97fb8b2ed22abdd9a48475c96bd327db968b7d9cace99655e"
+"checksum data-encoding-macro 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9864bace8597a3e0cc02c120f678e5def886b428ad584ddb6f784984af21de7d"
+"checksum data-encoding-macro-internal 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f40eac430a0f672126b89e606465ff50f1ea468daa42b1547732a78971346d5e"
 "checksum der-parser 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9984fa1478c9bcdabce05d1b1cf2ee7cc134e494d830ab1d3f0f86e284a778f7"
 "checksum diesel 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "164080ac16a4d1d80a50f0a623e4ddef41cb2779eee85bcc76907d340dfc98cc"
 "checksum diesel_derives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03bcaf77491f53e400d5ee3bdd57142ea4e1c47fe9217b3361ff9a76ca0e3d37"
@@ -3011,7 +3112,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d0a1279c96732bc6800ce6337b6a614697b0e74ae058dc03c62ebeb78b4d86"
 "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd"
 "checksum dtoa-short 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "59020b8513b76630c49d918c33db9f4c91638e7d3404a28084083b87e33f76f2"
-"checksum encoding_rs 0.8.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ca20350a7cb5aab5b9034731123d6d412caf3e92d4985e739e411ba0955fd0eb"
+"checksum encoding_rs 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1a8fa54e6689eb2549c4efed8d00d7f3b2b994a064555b0e8df4ae3764bcc4be"
+"checksum endian-type 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
 "checksum env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e"
 "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e"
 "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067"
@@ -3041,15 +3143,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum html5ever 0.22.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c213fa6a618dc1da552f54f85cba74b05d8e883c92ec4e89067736938084c26e"
 "checksum http 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "02096a6d2c55e63f7fcb800690e4f889a25f6ec342e3adb4594e293b625215ab"
 "checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83"
-"checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
+"checksum humantime 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ca7e5f2e110db35f93b837c81797f3714500b81d517bf20c431b16d3ca4f114"
 "checksum hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "df0caae6b71d266b91b4a83111a61d2b94ed2e2bea024c532b933dcff867e58c"
 "checksum hyper 0.12.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0aeedb8ca5f0f96be00f84073c6d0d5f962ecad020ef543dff99a7c12717a60e"
 "checksum hyper-rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68f2aa6b1681795bf4da8063f718cd23145aa0c9a5143d9787b345aa60d38ee4"
+"checksum hyper-rustls 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "38ece6707d74e77f6bf723249757245c66236d4c600c1916c0bf9a84bcf288fd"
 "checksum hyper-tls 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "32cd73f14ad370d3b4d4b7dce08f69b81536c82e39fcc89731930fe5788cd661"
 "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
 "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d"
 "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
-"checksum ipconfig 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "fccb81dd962b29a25de46c4f46e497b75117aa816468b6fff7a63a598a192394"
+"checksum ipconfig 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "08f7eadeaf4b52700de180d147c4805f199854600b36faa963d91114827b2ffc"
 "checksum isatty 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e31a8281fc93ec9693494da65fbf28c0c2aa60a2eaec25dc58e2f31952e95edc"
 "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
 "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
@@ -3062,11 +3165,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum libflate 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "21138fc6669f438ed7ae3559d5789a5f0ba32f28c1f0608d1e452b0bb06ee936"
 "checksum libsqlite3-sys 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d3711dfd91a1081d2458ad2d06ea30a8755256e74038be2ad927d94e1c955ca8"
 "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
-"checksum linked-hash-map 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7860ec297f7008ff7a1e3382d7f7e1dcd69efc94751a2284bafc3d013c2aa939"
 "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
 "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
 "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
-"checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21"
 "checksum lua52-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d451db153c94e455dc817d388f9674f6232425c28db3509e90251c55b8df2f94"
 "checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
 "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43"
@@ -3086,6 +3187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8e08de0070bbf4c31f452ea2a70db092f36f6f2e4d897adf5674477d488fb2"
 "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
 "checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4"
+"checksum nibble_vec 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa"
 "checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
 "checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945"
 "checksum nom 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9c349f68f25f596b9f44cf0e7c69752a5c633b0550c3ff849518bfba0233774a"
@@ -3115,6 +3217,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum pledge 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2b18e3ecf06a0c1dbaec50d88bc89d4b8769001c8d46e952a42cf93e8b6ebe5"
 "checksum pq-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac25eee5a0582f45a67e837e350d784e7003bd29a5f460796772061ca49ffda"
 "checksum precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
+"checksum proc-macro-hack 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c725b36c99df7af7bf9324e9c999b9e37d92c8f8caf106d82e1d7953218d2d8"
+"checksum proc-macro-hack-impl 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b753ad9ed99dd8efeaa7d2fb8453c8f6bc3e54b97966d35f1bc77ca6865254a"
 "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7"
 "checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09"
 "checksum procedural-masquerade 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9a1574a51c3fd37b26d2c0032b649d08a7d51d4cca9c41bbc5bf7118fa4509d0"
@@ -3124,20 +3228,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8"
 "checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
 "checksum r2d2 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5d746fc8a0dab19ccea7ff73ad535854e90ddb3b4b8cdce953dd5cd0b2e7bd22"
+"checksum radix_trie 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ebcf72e767017c1aa4b63d4dd0b0b836a243b648fd81d41c6bf6e850ef7a95c7"
 "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1"
 "checksum rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8356f47b32624fef5b3301c1be97e5944ecdd595409cc5da11d05f211db6cfbd"
 "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
-"checksum rand 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de3f08319b5395bd19b70e73c4c465329495db02dafeb8ca711a20f1c2bd058c"
+"checksum rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9d223d52ae411a33cf7e54ec6034ec165df296ccd23533d671a28252b6f66a"
 "checksum rand_chacha 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "771b009e3a508cb67e8823dda454aaa5368c7bc1c16829fb77d3e980440dd34a"
 "checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
 "checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
 "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
-"checksum rand_isaac 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6ecfe9ebf36acd47a49d150990b047a5f7db0a7236ee2414b7ff5cc1097c7b"
+"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
 "checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
 "checksum rand_xorshift 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effa3fcaa47e18db002bdde6060944b6d2f9cfd8db471c30e873448ad9187be3"
 "checksum rayon 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a77c51c07654ddd93f6cb543c7a849863b03abc7e82591afda6dc8ad4ac3ac4a"
 "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356"
-"checksum redox_syscall 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "cf8fb82a4d1c9b28f1c26c574a5b541f5ffb4315f6c9a791fa47b6a04438fe93"
+"checksum redox_syscall 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "679da7508e9a6390aeaf7fbd02a800fdc64b73fe2204dd2c8ae66d22d9d5ad5d"
 "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
 "checksum redox_users 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "214a97e49be64fd2c86f568dd0cb2c757d2cc53de95b273b6ad0a1c908482f26"
 "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
@@ -3158,6 +3263,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
 "checksum rusticata-macros 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe8c976e50876cb3423699b190e799ff4c8a1a4f47dc33f4036dd056c077b7bb"
 "checksum rustls 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "942b71057b31981152970d57399c25f72e27a6ee0d207a669d8304cabf44705b"
+"checksum rustls 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b7891791343c75b73ed9a18cadcafd8c8563d11a88ebe2d87f5b8a3182654d9"
 "checksum rustyline 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6010155119d53aac4f5b987cb8f6ea913d0d64d9b237da36f8f96a90cb3f5385"
 "checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
 "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
@@ -3199,12 +3305,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
 "checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b"
 "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
-"checksum syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)" = "816b7af21405b011a23554ea2dc3f6576dc86ca557047c34098c1d741f10f823"
+"checksum syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)" = "ae8b29eb5210bc5cf63ed6149cbf9adfc82ac0be023d8735c176ee74a2db4da7"
 "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
 "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
 "checksum syscallz 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ba6c26a802c1b51eb4a9c88a37000c6b7e443994d6b53dfcdf85b69dbec045"
 "checksum tar 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a303ba60a099fcd2aaa646b14d2724591a96a75283e4b7ed3d1a1658909d9ae2"
-"checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b"
+"checksum tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7e91405c14320e5c79b3d148e1c86f40749a36e490642202a31689cb1a3452b2"
 "checksum tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9de21546595a0873061940d994bbbc5c35f024ae4fd61ec5c5b159115684f508"
 "checksum termcolor 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4096add70612622289f2fdcdbd5086dc81c1e2675e6ae58d6c4f62a16c6d7f2f"
 "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
@@ -3222,6 +3328,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum tokio-io 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7392fe0a70d5ce0c882c4778116c519bd5dbaa8a7c3ae3d04578b3afafdcda21"
 "checksum tokio-reactor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "502b625acb4ee13cbb3b90b8ca80e0addd263ddacf6931666ef751e610b07fb5"
 "checksum tokio-rustls 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "208d62fa3e015426e3c64039d9d20adf054a3c9b4d9445560f1c41c75bef3eab"
+"checksum tokio-rustls 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1c98c5346e4231382951111f42f4651094854462297370a08f0fba57a3b92576"
 "checksum tokio-tcp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad235e9dadd126b2d47f6736f65aa1fdcd6420e66ca63f44177bc78df89f912"
 "checksum tokio-threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "56c5556262383032878afad66943926a1d1f0967f17e94bd7764ceceb3b70e7f"
 "checksum tokio-timer 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4f37f0111d76cc5da132fe9bc0590b9b9cfd079bc7e75ac3846278430a299ff8"
@@ -3229,8 +3336,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum tokio-uds 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "99ce87382f6c1a24b513a72c048b2c8efe66cb5161c9061d00bee510f08dc168"
 "checksum toml 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "19782e145d5abefb03758958f06ea35f7b1d8421b534140e0238fd3d0bfd66e3"
 "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
+"checksum trust-dns 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f9b3df6034a7e2836b5300e6a1dd5648a4e8fdd62729331ed05027ea16de8e4"
 "checksum trust-dns-proto 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0838272e89f1c693b4df38dc353412e389cf548ceed6f9fd1af5a8d6e0e7cf74"
-"checksum trust-dns-resolver 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4e913a5df94658858e548cc95a3212797ee524e487ede091c32f27ca26e11620"
 "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382"
 "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887"
 "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169"
diff --git a/Cargo.toml b/Cargo.toml
index 430c3367..cedf0215 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,8 +32,7 @@ diesel = { version = "1.0.0", features = ["sqlite"] }
 diesel_migrations = { version = "1.3.0", features = ["sqlite"] }
 dirs = "1.0"
 url = "1.7"
-chrootable-https = "0.3.4"
-trust-dns-proto = "0.5.0"
+chrootable-https = "0.5.0"
 base64 = "0.10"
 kuchiki = "0.7.2"
 serde_urlencoded = "0.5"
diff --git a/docs/reference.rst b/docs/reference.rst
index 53718228..571367b7 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -55,15 +55,33 @@ Update an entity in the database. This function may fail. See `db_update
 dns
 ---
 
-Resolve a dns record. In the dns response contains an error, ``x['error']`` is
-set and ``x['success']`` is ``nil``. Otherwise, ``x['success']`` contains a
-list of records. This function may fail.
+Resolve a dns record. If the dns query was successful and the dns reply is
+``NoError`` then ``x['error']`` is ``nil``. The records of the reply are in
+``x['answers']``. This function may fail.
+
+This function accepts the following options:
+
+``record``
+  The ``query_type``, can be any of ``A``, ``AAAA``, ``MX``, ``AXFR``, etc.
+``nameserver``
+  The server that should be used for the lookup. Defaults to your system
+  resolver.
+``tcp``
+  If the lookup should use tcp, true/false.
+``timeout``
+  The time until the query times out in milliseconds.
 
 .. code-block:: lua
 
-    x = dns('example.com', 'A')
+    x = dns('example.com', {
+        record='A'
+    })
     if last_err() then return end
 
+.. note::
+   DNS replies with an error code set are not causing a change to
+   ``last_err()``. You have to test for this explicitly.
+
 error
 -----
 
@@ -147,19 +165,19 @@ Please note that you still need to specify an empty table ``{}`` even if no
 options are set. The following options are available:
 
 ``query``
-  A map of query parameters that should be set on the url
+  A map of query parameters that should be set on the url.
 ``headers``
-  A map of headers that should be set
+  A map of headers that should be set.
 ``basic_auth``
-  Configure the basic auth header with ``{"user, "password"}``
+  Configure the basic auth header with ``{"user, "password"}``.
 ``user_agent``
-  Overwrite the default user agent with a string
+  Overwrite the default user agent with a string.
 ``json``
-  The request body that should be json encoded
+  The request body that should be json encoded.
 ``form``
-  The request body that should be form encoded
+  The request body that should be form encoded.
 ``body``
-  The raw request body as string
+  The raw request body as string.
 
 This function may fail.
 
diff --git a/docs/scripting.rst b/docs/scripting.rst
index 97395e12..9cd55763 100644
--- a/docs/scripting.rst
+++ b/docs/scripting.rst
@@ -101,25 +101,30 @@ truth-y.
     function run(arg)
         subdomain = 'www.' .. arg['value']
 
-        records = dns(subdomain, 'A')
+        records = dns(subdomain, {
+            record='A'
+        })
         if last_err() then return end
 
         print(records)
     end
 
 If you run your module again you're going to see some output, either
-``{"success": somedata}`` or ``{"error": "NX"}``. We decide if ``success`` is
-not ``nil``, we add the subdomain to our scope and set it to resolvable:
+``{"answers":[somedata],"error":null}`` or
+``{"answers":[],"error":"NXDomain"}``. We decide that we add the subdomain to
+our scope and set it to resolvable if ``error`` is ``nil``.
 
 .. code-block:: lua
 
     function run(arg)
         subdomain = 'www.' .. arg['value']
 
-        records = dns(subdomain, 'A')
+        records = dns(subdomain, {
+            record='A'
+        })
         if last_err() then return end
 
-        if records['success'] ~= nil then
+        if records['error'] == nil then
             db_add('subdomain', arg, {
                 domain_id=arg['id'],
                 value=subdomain,
@@ -148,7 +153,9 @@ After putting everything together, our final module looks like this:
     function run(arg)
         subdomain = 'www.' .. arg['value']
 
-        records = dns(subdomain, 'A')
+        records = dns(subdomain, {
+            record='A'
+        })
         if last_err() then return end
 
         if records['success'] ~= nil then
diff --git a/modules/dev/axfr.lua b/modules/dev/axfr.lua
new file mode 100644
index 00000000..46cd4235
--- /dev/null
+++ b/modules/dev/axfr.lua
@@ -0,0 +1,159 @@
+-- Description: Try a zone transfer for subdomains
+-- Version: 0.1.0
+-- Source: domains
+-- License: GPL-3.0
+
+function strip_root_dot(name)
+    m = regex_find("(.+)\\.$", name)
+    if last_err() then return end
+
+    if m == nil then
+        return name
+    else
+        return m[2]
+    end
+end
+
+function add_pointer(name)
+    local domain, domain_id, subdomain_id
+
+    -- select psl+1
+    domain = psl_domain_from_dns_name(name)
+    if last_err() then return end
+
+    -- add domain
+    domain_id = db_add('domain', {
+        value=domain,
+    })
+    if last_err() then return end
+    if domain_id == nil then return end
+
+    -- add subdomain
+    subdomain_id = db_add('subdomain', {
+        domain_id=domain_id,
+        value=name,
+    })
+    if last_err() then return end
+end
+
+function iter_axfr(zone, arg)
+    local name, r, m, domain
+
+    debug(json_encode(arg))
+
+    name = arg[1]
+    r = arg[2]
+
+    -- select psl+1
+    domain = psl_domain_from_dns_name(name)
+    if last_err() then return end
+
+    -- add domain
+    domain_id = db_add('domain', {
+        value=domain,
+    })
+    if last_err() then return end
+    if domain_id == nil then return end
+
+    -- add subdomain
+    subdomain_id = db_add('subdomain', {
+        domain_id=domain_id,
+        value=name,
+    })
+    if last_err() then return end
+
+    -- this is a A record
+    if r['A'] ~= nil then
+        -- add the name and ip
+        ipaddr_id = db_add('ipaddr', {
+            family='4',
+            value=r['A'],
+        })
+        if last_err() then return end
+
+        db_add('subdomain-ipaddr', {
+            subdomain_id=subdomain_id,
+            ip_addr_id=ipaddr_id,
+        })
+        if last_err() then return end
+    end
+
+    if r['CNAME'] ~= nil then
+        -- add the name and the name it's pointing to
+        name = strip_root_dot(r['CNAME'])
+        add_pointer(name)
+    end
+
+    if r['NS'] ~= nil then
+        -- add the name and the name it's pointing to
+        name = strip_root_dot(r['NS'])
+        add_pointer(name)
+    end
+
+    if r['MX'] ~= nil then
+        -- add the name and the name it's pointing to
+        name = strip_root_dot(r['MX'][2])
+        add_pointer(name:lower())
+    end
+end
+
+function iter_a(zone, arg)
+    local i, records, r
+
+    if arg == nil then return end
+
+    debug('nameserver: ' .. arg)
+    records = dns(zone, {
+        record='AXFR',
+        nameserver=arg .. ':53',
+        tcp=true,
+    })
+    if last_err() then return end
+    if records['error'] ~= nil then return end
+    records = records['answers']
+
+    i = 1
+    while records[i] ~= nil do
+        iter_axfr(zone, records[i])
+        if last_err() then return end
+        i = i+1
+    end
+end
+
+function iter_ns(zone, arg)
+    local i, records, r
+
+    if arg == nil then return end
+
+    records = dns(arg, {
+        record='A',
+    })
+    if last_err() then return end
+    if records['error'] ~= nil then return end
+    records = records['answers']
+
+    i = 1
+    while records[i] ~= nil do
+        r = records[i][2]
+        iter_a(zone, r['A'])
+        if last_err() then return end
+        i = i+1
+    end
+end
+
+function run(arg)
+    records = dns(arg['value'], {
+        record='NS',
+    })
+    if last_err() then return end
+    if records['error'] ~= nil then return end
+    records = records['answers']
+
+    i = 1
+    while records[i] ~= nil do
+        r = records[i][2]
+        iter_ns(arg['value'], r['NS'])
+        if last_err() then return end
+        i = i+1
+    end
+end
diff --git a/modules/dev/cname-harvest.lua b/modules/dev/cname-harvest.lua
index ec40351b..d8543a43 100644
--- a/modules/dev/cname-harvest.lua
+++ b/modules/dev/cname-harvest.lua
@@ -34,20 +34,16 @@ function iter(r)
 end
 
 function run(arg)
-    records = dns(arg['value'], 'CNAME')
+    records = dns(arg['value'], 'A')
     if last_err() then return end
 
-    if records['success'] == nil then return end
-    records = records['success']
-
-    -- there is a bug in struct -> lua that causes tables to be zero indexed
-    -- this checks if there's something at index 0 but uses index 1 if this is fixed
-    i = 0
-    if records[i] == nil then i = 1 end
+    if records['error'] ~= nil then return end
+    records = records['answers']
 
+    i = 1
     while records[i] ~= nil do
-        r = records[i]['CNAME']
-        iter(r)
+        r = records[i][2]
+        iter(r['CNAME'])
         if last_err() then return end
         i = i+1
     end
diff --git a/modules/dev/ctlogs.lua b/modules/dev/ctlogs.lua
index dc82ae58..3c2fa28b 100644
--- a/modules/dev/ctlogs.lua
+++ b/modules/dev/ctlogs.lua
@@ -28,6 +28,7 @@ function run(arg)
         -- print(c)
 
         name = c['name_value']
+        debug(json_encode(name))
 
         if name:find("*.") == 1 then
             -- ignore wildcard domains
@@ -35,7 +36,6 @@ function run(arg)
         end
 
         if seen[name] == nil then
-            -- info(name)
             db_add('subdomain', {
                 domain_id=arg['id'],
                 value=name,
diff --git a/modules/dev/dns-resolve.lua b/modules/dev/dns-resolve.lua
index 59f0dfab..08a3dd2f 100644
--- a/modules/dev/dns-resolve.lua
+++ b/modules/dev/dns-resolve.lua
@@ -8,7 +8,7 @@ function run(arg)
     if last_err() then return end
 
     -- update subdomain
-    resolvable = records['success'] ~= nil
+    resolvable = records['error'] == nil
     if arg['resolvable'] ~= resolvable then
         -- TODO: pass arg to function as well
         db_update('subdomain', arg, {
@@ -20,15 +20,11 @@ function run(arg)
         return
     end
 
-    records = records['success']
-
-    -- there is a bug in struct -> lua that causes tables to be zero indexed
-    -- this checks if there's something at index 0 but uses index 1 if this is fixed
-    i = 0
-    if records[i] == nil then i = 1 end
+    records = records['answers']
 
+    i = 1
     while records[i] ~= nil do
-        r = records[i]
+        r = records[i][2]
         if r['A'] ~= nil then
             ipaddr_id = db_add('ipaddr', {
                 family='4',
@@ -40,6 +36,7 @@ function run(arg)
                 subdomain_id=arg['id'],
                 ip_addr_id=ipaddr_id,
             })
+            if last_err() then return end
         end
         i = i+1
     end
diff --git a/modules/dev/otx-subdomains.lua b/modules/dev/otx-subdomains.lua
index 2dfe5bdb..944aa47f 100644
--- a/modules/dev/otx-subdomains.lua
+++ b/modules/dev/otx-subdomains.lua
@@ -18,7 +18,7 @@ function run(arg)
     if last_err() then return end
     o = o['passive_dns']
 
-    i = 0
+    i = 1
     while o[i] do
         x = o[i]
 
diff --git a/modules/dev/threatminer-ipaddr.lua b/modules/dev/threatminer-ipaddr.lua
index 9ca30210..d5f1a939 100644
--- a/modules/dev/threatminer-ipaddr.lua
+++ b/modules/dev/threatminer-ipaddr.lua
@@ -23,7 +23,7 @@ function run(arg)
     if last_err() then return end
     o = o['results']
 
-    i = 0
+    i = 1
     while o[i] do
         x = o[i]
 
diff --git a/modules/dev/threatminer-subdomains.lua b/modules/dev/threatminer-subdomains.lua
index 9015183d..fdcd0882 100644
--- a/modules/dev/threatminer-subdomains.lua
+++ b/modules/dev/threatminer-subdomains.lua
@@ -21,7 +21,7 @@ function run(arg)
     if last_err() then return end
     o = o['results']
 
-    i = 0
+    i = 1
     while o[i] do
         x = o[i]
 
diff --git a/modules/dev/waybackurls.lua b/modules/dev/waybackurls.lua
index 96177403..ccc88022 100644
--- a/modules/dev/waybackurls.lua
+++ b/modules/dev/waybackurls.lua
@@ -18,21 +18,21 @@ function run(arg)
     if last_err() then return end
 
     -- no known urls
-    if o[0] == nil then
+    if o[1] == nil then
         return
     end
 
     -- ensure the api response is still what we expect
-    if o[0][2] == nil then
+    if o[1][3] == nil then
         return 'api returned unexpected json format'
     end
 
     seen = {}
 
-    i = 1
+    i = 2
     while o[i] do
-        url = o[i][2]
-
+        url = o[i][3]
+        debug(json_encode(url))
         parts = url_parse(url)
 
         if last_err() then
@@ -40,6 +40,7 @@ function run(arg)
             error("Failed to parse url: " .. json_encode(url))
         else
             subdomain = parts['host']
+            subdomain, _ = subdomain:gsub('%.$', '')
 
             if seen[subdomain] == nil then
                 db_add('subdomain', {
diff --git a/src/args.rs b/src/args.rs
index 447ccadb..0c332400 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -56,6 +56,8 @@ pub struct Run {
     pub file: Option<String>,
     #[structopt(short="j", long="threads", default_value="1")]
     pub threads: usize,
+    #[structopt(short="v", long="verbose", parse(from_occurrences))]
+    pub verbose: u64,
 }
 
 #[derive(Debug, StructOpt)]
diff --git a/src/cmd/run_cmd.rs b/src/cmd/run_cmd.rs
index 0b67cc95..5f78aec7 100644
--- a/src/cmd/run_cmd.rs
+++ b/src/cmd/run_cmd.rs
@@ -15,6 +15,8 @@ use worker;
 pub struct Args {
     #[structopt(short="j", long="threads", default_value="1")]
     threads: usize,
+    #[structopt(short="v", long="verbose", parse(from_occurrences))]
+    verbose: u64,
 }
 
 fn prepare_arg<T: Serialize + Model>(x: T) -> Result<(serde_json::Value, Option<String>)> {
@@ -30,7 +32,7 @@ fn prepare_args<T: Scopable + Serialize + Model>(db: &Database, filter: &Filter)
         .collect()
 }
 
-pub fn execute(rl: &mut Readline, threads: usize) -> Result<()> {
+pub fn execute(rl: &mut Readline, threads: usize, verbose: u64) -> Result<()> {
     let module = rl.module()
         .map(|m| m.to_owned())
         .ok_or_else(|| format_err!("No module selected"))?;
@@ -47,7 +49,7 @@ pub fn execute(rl: &mut Readline, threads: usize) -> Result<()> {
     }?;
 
     rl.signal_register().catch_ctrl();
-    worker::spawn(rl, &module, args, threads);
+    worker::spawn(rl, &module, args, threads, verbose);
     rl.signal_register().reset_ctrlc();
 
     term::info(&format!("Finished {}", module.canonical()));
@@ -57,5 +59,5 @@ pub fn execute(rl: &mut Readline, threads: usize) -> Result<()> {
 
 pub fn run(rl: &mut Readline, args: &[String]) -> Result<()> {
     let args = Args::from_iter_safe(args)?;
-    execute(rl, args.threads)
+    execute(rl, args.threads, args.verbose)
 }
diff --git a/src/engine/ctx.rs b/src/engine/ctx.rs
index bc2cd278..11eb4ffd 100644
--- a/src/engine/ctx.rs
+++ b/src/engine/ctx.rs
@@ -11,7 +11,7 @@ use serde_json;
 use std::collections::HashMap;
 use std::result;
 use std::sync::{Arc, Mutex};
-use chrootable_https::dns::DnsConfig;
+use chrootable_https::dns::Resolver;
 use web::{HttpSession, HttpRequest, RequestOptions};
 use worker::{Event, LogEvent, DatabaseEvent};
 
@@ -29,10 +29,18 @@ pub trait State {
 
     fn recv(&self) -> Result<serde_json::Value>;
 
+    fn verbose(&self) -> u64;
+
     fn info(&self, msg: String) {
         self.send(&Event::Log(LogEvent::Info(msg)))
     }
 
+    fn debug(&self, msg: String) {
+        if self.verbose() >= 2 {
+            self.send(&Event::Log(LogEvent::Debug(msg)))
+        }
+    }
+
     fn error(&self, msg: String) {
         self.send(&Event::Log(LogEvent::Error(msg)))
     }
@@ -65,7 +73,7 @@ pub trait State {
         reply.map_err(|err| format_err!("Failed to update database: {:?}", err))
     }
 
-    fn dns_config(&self) -> Arc<DnsConfig>;
+    fn dns_config(&self) -> Arc<Resolver>;
 
     fn psl(&self) -> Arc<Psl>;
 
@@ -85,7 +93,8 @@ pub struct LuaState {
     error: Arc<Mutex<Option<Error>>>,
     logger: Arc<Mutex<Option<Arc<Mutex<Box<Reporter>>>>>>,
     http_sessions: Arc<Mutex<HashMap<String, HttpSession>>>,
-    dns_config: Arc<DnsConfig>,
+    verbose: u64,
+    dns_config: Arc<Resolver>,
     psl: Arc<Psl>,
     geoip: Arc<GeoIP>,
     asn: Arc<AsnDB>,
@@ -132,7 +141,11 @@ impl State for LuaState {
         }
     }
 
-    fn dns_config(&self) -> Arc<DnsConfig> {
+    fn verbose(&self) -> u64 {
+        self.verbose
+    }
+
+    fn dns_config(&self) -> Arc<Resolver> {
         self.dns_config.clone()
     }
 
@@ -184,6 +197,7 @@ fn ctx<'a>(env: Environment) -> (hlua::Lua<'a>, Arc<LuaState>) {
         logger: Arc::new(Mutex::new(None)),
         http_sessions: Arc::new(Mutex::new(HashMap::new())),
 
+        verbose: env.verbose,
         dns_config: Arc::new(env.dns_config),
         psl: Arc::new(env.psl),
         geoip: Arc::new(env.geoip),
@@ -194,6 +208,7 @@ fn ctx<'a>(env: Environment) -> (hlua::Lua<'a>, Arc<LuaState>) {
     runtime::db_add(&mut lua, state.clone());
     runtime::db_select(&mut lua, state.clone());
     runtime::db_update(&mut lua, state.clone());
+    runtime::debug(&mut lua, state.clone());
     runtime::dns(&mut lua, state.clone());
     runtime::error(&mut lua, state.clone());
     runtime::asn_lookup(&mut lua, state.clone());
@@ -282,7 +297,7 @@ impl Script {
     pub fn test(&self) -> Result<()> {
         use engine::tests::DummyReporter;
         use geoip::Maxmind;
-        let dns_config = DnsConfig::from_system()?;
+        let dns_config = Resolver::from_system()?;
         let psl = Psl::from_str(r#"
 // ===BEGIN ICANN DOMAINS===
 com
@@ -292,6 +307,7 @@ com
         let asn = AsnDB::open_or_download()?;
 
         let env = Environment {
+            verbose: 0,
             dns_config,
             psl,
             geoip,
diff --git a/src/engine/isolation.rs b/src/engine/isolation.rs
index 19faa8c4..76db634c 100644
--- a/src/engine/isolation.rs
+++ b/src/engine/isolation.rs
@@ -1,5 +1,5 @@
 use errors::*;
-use chrootable_https::dns::DnsConfig;
+use chrootable_https::dns::Resolver;
 use engine::{Environment, Module, Reporter};
 use geoip::{GeoIP, AsnDB};
 use psl::Psl;
@@ -15,15 +15,17 @@ use std::process::{Command, Child, Stdio, ChildStdin, ChildStdout};
 
 #[derive(Debug, Serialize, Deserialize)]
 pub struct StartCommand {
-    dns_config: DnsConfig,
+    verbose: u64,
+    dns_config: Resolver,
     module: Module,
     arg: serde_json::Value,
 }
 
 impl StartCommand {
-    pub fn new(dns_config: DnsConfig, module: Module, arg: serde_json::Value) -> StartCommand {
+    pub fn new(verbose: u64, dns_config: Resolver, module: Module, arg: serde_json::Value) -> StartCommand {
         // TODO: compress psl
         StartCommand {
+            verbose,
             dns_config,
             module,
             arg
@@ -61,8 +63,8 @@ impl Supervisor {
         })
     }
 
-    pub fn send_start(&mut self, dns_config: DnsConfig, module: Module, arg: serde_json::Value) -> Result<()> {
-        let start = serde_json::to_value(StartCommand::new(dns_config, module, arg))?;
+    pub fn send_start(&mut self, start: &StartCommand) -> Result<()> {
+        let start = serde_json::to_value(&start)?;
         self.send(&start)?;
         Ok(())
     }
@@ -150,11 +152,11 @@ impl Reporter for StdioReporter {
     }
 }
 
-pub fn spawn_module(module: Module, tx: &EventSender, arg: serde_json::Value) -> Result<()> {
-    let dns_config = DnsConfig::from_system()?;
+pub fn spawn_module(module: Module, tx: &EventSender, arg: serde_json::Value, verbose: u64) -> Result<()> {
+    let dns_config = Resolver::from_system()?;
 
     let mut supervisor = Supervisor::setup(&module)?;
-    supervisor.send_start(dns_config, module, arg)?;
+    supervisor.send_start(&StartCommand::new(verbose, dns_config, module, arg))?;
 
     loop {
         match supervisor.recv()? {
@@ -182,6 +184,7 @@ pub fn run_worker(geoip: GeoIP, asn: AsnDB, psl: String) -> Result<()> {
         .context("Failed to load public suffix list")?;
 
     let environment = Environment {
+        verbose: start.verbose,
         dns_config: start.dns_config,
         psl,
         geoip,
diff --git a/src/engine/mod.rs b/src/engine/mod.rs
index 558cf798..71ec266c 100644
--- a/src/engine/mod.rs
+++ b/src/engine/mod.rs
@@ -11,7 +11,7 @@ use std::sync::{Arc, Mutex};
 use engine::ctx::Script;
 use sn0int_common::ModuleID;
 use sn0int_common::metadata::{Metadata, Source};
-use chrootable_https::dns::DnsConfig;
+use chrootable_https::dns::Resolver;
 use psl::Psl;
 use paths;
 use std::cmp::Ordering;
@@ -26,7 +26,8 @@ pub mod structs;
 /// Data that is passed to every script
 #[derive(Debug)]
 pub struct Environment {
-  pub dns_config: DnsConfig,
+  pub verbose: u64,
+  pub dns_config: Resolver,
   pub psl: Psl,
   pub geoip: GeoIP,
   pub asn: AsnDB,
diff --git a/src/json.rs b/src/json.rs
index 332c7ca3..846ba613 100644
--- a/src/json.rs
+++ b/src/json.rs
@@ -64,9 +64,8 @@ impl Into<AnyLuaValue> for LuaJsonValue {
             // TODO: not sure if this might fail
             LuaJsonValue::Number(v) => AnyLuaValue::LuaNumber(v.as_f64().unwrap()),
             LuaJsonValue::String(v) => AnyLuaValue::LuaString(v),
-            // TODO: ensure lua tables always start at 1
             LuaJsonValue::Array(v) => AnyLuaValue::LuaArray(v.into_iter().enumerate()
-                .map(|(i, x)| (AnyLuaValue::LuaNumber(i as f64), x.into()))
+                .map(|(i, x)| (AnyLuaValue::LuaNumber((i+1) as f64), x.into()))
                 .collect()
             ),
             LuaJsonValue::Object(v) => AnyLuaValue::LuaArray(v.into_iter()
diff --git a/src/lib.rs b/src/lib.rs
index 19ff7120..ce2cd71c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -10,7 +10,6 @@ extern crate shellwords;
 extern crate dirs;
 extern crate publicsuffix;
 extern crate chrootable_https;
-extern crate trust_dns_proto;
 extern crate url;
 #[cfg(target_os = "linux")]
 extern crate nix;
diff --git a/src/main.rs b/src/main.rs
index 90a0606b..e70189aa 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -42,7 +42,7 @@ fn run_run(gargs: &Args, args: &args::Run, config: Config) -> Result<()> {
         bail!("At least one module or file need to be provided");
     }
 
-    cmd::run_cmd::execute(&mut rl, args.threads)
+    cmd::run_cmd::execute(&mut rl, args.threads, args.verbose)
 }
 
 fn run_sandbox() -> Result<()> {
diff --git a/src/runtime/dns.rs b/src/runtime/dns.rs
index ff3a8a67..81882a54 100644
--- a/src/runtime/dns.rs
+++ b/src/runtime/dns.rs
@@ -1,23 +1,75 @@
 use errors::*;
 
-use chrootable_https::{Resolver, DnsResolver};
+use chrootable_https::dns::{Resolver, DnsResolver, RecordType};
+use engine;
 use engine::ctx::State;
 use json::LuaJsonValue;
 use hlua::{self, AnyLuaValue};
 use serde_json;
 use std::sync::Arc;
-use trust_dns_proto;
+use std::net::SocketAddr;
+use std::time::Duration;
 
 
+#[derive(Debug, Deserialize)]
+pub struct ResolveOptions {
+    //record: RecordType,
+    record: String,
+    // TODO: this could be more than one
+    nameserver: Option<SocketAddr>,
+    #[serde(default)]
+    tcp: bool,
+    timeout: Option<u64>,
+}
+
+impl ResolveOptions {
+    pub fn new(record: String) -> Result<ResolveOptions> {
+        let record = record.parse()?;
+        Ok(ResolveOptions {
+            record,
+            nameserver: None,
+            tcp: false,
+            timeout: None,
+        })
+    }
+
+    pub fn record_type(&self) -> Result<RecordType> {
+        self.record.parse()
+            .map_err(Error::from)
+    }
+
+    pub fn from_lua(x: AnyLuaValue) -> Result<ResolveOptions> {
+        match x {
+            AnyLuaValue::LuaAnyString(s) => {
+                let s = String::from_utf8(s.0)?;
+                ResolveOptions::new(s)
+            },
+            AnyLuaValue::LuaString(s) => ResolveOptions::new(s),
+            x => engine::structs::from_lua(x.into()),
+        }
+    }
+}
+
 pub fn dns(lua: &mut hlua::Lua, state: Arc<State>) {
-    lua.set("dns", hlua::function2(move |name: String, record: String| -> Result<AnyLuaValue> {
-        let resolver = Resolver::from_config(state.dns_config().as_ref().clone())
+    lua.set("dns", hlua::function2(move |name: String, options: AnyLuaValue| -> Result<AnyLuaValue> {
+        let options = ResolveOptions::from_lua(options)
             .map_err(|e| state.set_error(e))?;
 
-        let record = record.parse()
-            .map_err(|e: trust_dns_proto::error::ProtoError| state.set_error(e.into()))?;
+        let ns = match options.nameserver {
+            Some(ns) => vec![ns],
+            None => state.dns_config().ns.clone(),
+        };
+
+        let timeout = options.timeout
+            .map(Duration::from_millis);
 
-        let reply = resolver.resolve_adv(&name, record)
+        let resolver = Resolver {
+            ns,
+            tcp: options.tcp,
+            timeout,
+        };
+
+        let reply = resolver.resolve(&name, options.record_type()?)
             .map_err(|e| state.set_error(e))?;
 
         let reply = serde_json::to_value(reply)
@@ -38,8 +90,28 @@ mod tests {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('example.com', 'A')
+            if last_err() then return end
+            print(x)
+            if x['answers'][1][2]['A'] == nil then
+                return "Couldn't resolve"
+            end
+        end
+        "#).expect("Failed to load script");
+        script.test().expect("Script failed");
+    }
+
+    #[test]
+    #[ignore]
+    fn verify_custom_resolver_a() {
+        let script = Script::load_unchecked(r#"
+        function run()
+            x = dns('example.com', {
+                record='A',
+                nameserver='1.1.1.1:53',
+            })
+            if last_err() then return end
             print(x)
-            if x['success'][0]['A'] == nil then
+            if x['answers'][1][2]['A'] == nil then
                 return "Couldn't resolve"
             end
         end
@@ -47,14 +119,82 @@ mod tests {
         script.test().expect("Script failed");
     }
 
+    #[test]
+    #[ignore]
+    fn verify_custom_resolver_axfr() {
+        let script = Script::load_unchecked(r#"
+        function run()
+            x = dns('zonetransfer.me', {
+                record='AXFR',
+                nameserver='81.4.108.41:53',
+                tcp=true,
+                timeout=15000,
+            })
+            if last_err() then return end
+            print(x)
+
+            if x['error'] ~= nil then
+                return 'Error: ' .. x['error']
+            end
+
+            has_soa = false
+            has_ns = false
+            has_a = false
+            has_mx = false
+
+            i = 1
+            answers = x['answers']
+            while answers[i] do
+                r = answers[i][2]
+
+                if r['SOA'] ~= nil then
+                    has_soa = true
+                end
+
+                if r['NS'] ~= nil then
+                    has_ns = true
+                end
+
+                if r['A'] ~= nil then
+                    has_a = true
+                end
+
+                if r['MX'] ~= nil then
+                    has_mx = true
+                end
+
+                i = i+1
+            end
+
+            if not has_soa then
+                return 'Error: missing soa'
+            end
+
+            if not has_ns then
+                return 'Error: missing ns'
+            end
+
+            if not has_a then
+                return 'Error: missing a'
+            end
+
+            if not has_mx then
+                return 'Error: missing mx'
+            end
+        end
+        "#).expect("Failed to load script");
+        script.test().expect("Script failed");
+    }
+
     #[test]
     #[ignore]
     fn verify_resolve_aaaa() {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('example.com', 'AAAA')
+            if last_err() then return end
             print(x)
-            if x['success'][0]['AAAA'] == nil then
+            if x['answers'][1][2]['AAAA'] == nil then
                 return "Couldn't resolve"
             end
         end
@@ -68,8 +208,9 @@ mod tests {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('example.com', 'TXT')
+            if last_err() then return end
             print(x)
-            if x['success'][0]['TXT'] == nil then
+            if x['answers'][1][2]['TXT'] == nil then
                 return "Couldn't resolve"
             end
         end
@@ -83,8 +224,9 @@ mod tests {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('example.com', 'NS')
+            if last_err() then return end
             print(x)
-            if x['success'][0]['NS'] == nil then
+            if x['answers'][1][2]['NS'] == nil then
                 return "Couldn't resolve"
             end
         end
@@ -98,8 +240,9 @@ mod tests {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('example.com', 'SOA')
+            if last_err() then return end
             print(x)
-            if x['success'][0]['SOA'] == nil then
+            if x['answers'][1][2]['SOA'] == nil then
                 return "Couldn't resolve"
             end
         end
@@ -113,8 +256,9 @@ mod tests {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('1.1.1.1.in-addr.arpa', 'PTR')
+            if last_err() then return end
             print(x)
-            if x['success'][0]['PTR'] == nil then
+            if x['answers'][1][2]['PTR'] == nil then
                 return "Couldn't resolve"
             end
         end
@@ -128,8 +272,27 @@ mod tests {
         let script = Script::load_unchecked(r#"
         function run()
             x = dns('doesntexist.example.com', 'A')
+            if last_err() then return end
             print(x)
-            return x['success'] == nil
+            if x['error'] ~= 'NXDomain' then
+                return "Expected NXDomain"
+            end
+        end
+        "#).expect("Failed to load script");
+        script.test().expect("Script failed");
+    }
+
+    #[test]
+    #[ignore]
+    fn verify_empty_cname() {
+        let script = Script::load_unchecked(r#"
+        function run()
+            x = dns('example.com', 'CNAME')
+            if last_err() then return end
+            print(x)
+            if x['error'] ~= nil then
+                return "Expected no error"
+            end
         end
         "#).expect("Failed to load script");
         script.test().expect("Script failed");
diff --git a/src/runtime/logger.rs b/src/runtime/logger.rs
index b7ae488d..0f9f2330 100644
--- a/src/runtime/logger.rs
+++ b/src/runtime/logger.rs
@@ -9,6 +9,12 @@ pub fn info(lua: &mut hlua::Lua, state: Arc<State>) {
     }))
 }
 
+pub fn debug(lua: &mut hlua::Lua, state: Arc<State>) {
+    lua.set("debug", hlua::function1(move |msg: String| {
+        state.debug(msg);
+    }))
+}
+
 pub fn error(lua: &mut hlua::Lua, state: Arc<State>) {
     lua.set("error", hlua::function1(move |msg: String| {
         state.error(msg);
diff --git a/src/runtime/x509.rs b/src/runtime/x509.rs
index 417f91e2..7d16b02b 100644
--- a/src/runtime/x509.rs
+++ b/src/runtime/x509.rs
@@ -73,7 +73,7 @@ WUjbST4VXmdaol7uzFMojA4zkxQDZAvF5XgJlAFadfySna/teik=
             print(x)
 
             vn = {}
-            i = 0
+            i = 1
             while x['valid_names'][i] do
                 vn[x['valid_names'][i]] = true
                 i = i+1
@@ -87,7 +87,7 @@ WUjbST4VXmdaol7uzFMojA4zkxQDZAvF5XgJlAFadfySna/teik=
                 return 'Not valid for github.com'
             end
 
-            if i ~= 2 then
+            if i ~= 3 then
                 return 'Unexpected number of names'
             end
         end
@@ -127,14 +127,14 @@ ZkZZmqNn2Q8=
             print(x)
 
             vn = {}
-            i = 0
+            i = 1
             while x['valid_names'][i] do
                 vn[x['valid_names'][i]] = true
                 i = i+1
             end
 
             vi = {}
-            j = 0
+            j = 1
             while x['valid_ipaddrs'][j] do
                 vi[x['valid_ipaddrs'][j]] = true
                 j = j+1
@@ -146,7 +146,7 @@ ZkZZmqNn2Q8=
             if not vn['cloudflare-dns.com'] then
                 return 'Not valid for cloudflare-dns.com'
             end
-            if i ~= 2 then
+            if i ~= 3 then
                 return 'Unexpected number of names'
             end
 
@@ -162,7 +162,7 @@ ZkZZmqNn2Q8=
             if not vi['2606:4700:4700::1111'] then
                 return 'Not valid for 2606:4700:4700::1111'
             end
-            if j ~= 4 then
+            if j ~= 5 then
                 return 'Unexpected number of ip addrs'
             end
         end
diff --git a/src/term.rs b/src/term.rs
index b1fe13f4..9551ec28 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -52,6 +52,8 @@ pub static SPINNERS: &[&[&str]] = &[
 pub trait SpinLogger {
     fn log(&mut self, line: &str);
 
+    fn debug(&mut self, line: &str);
+
     fn error(&mut self, line: &str);
 
     fn status(&mut self, status: String);
@@ -117,6 +119,10 @@ impl SpinLogger for Spinner {
         println!("\r\x1b[2K\x1b[1m[\x1b[34m{}\x1b[0;1m]\x1b[0m {}", '*', line);
     }
 
+    fn debug(&mut self, line: &str) {
+        println!("\r\x1b[2K\x1b[1m[\x1b[34m{}\x1b[0;1m]\x1b[0m {}", '#', line);
+    }
+
     fn error(&mut self, line: &str) {
         println!("\r\x1b[2K\x1b[1m[\x1b[31m{}\x1b[0;1m]\x1b[0m {}", '-', line);
     }
@@ -134,6 +140,10 @@ pub fn info(line: &str) {
     println!("\x1b[1m[\x1b[32m{}\x1b[0;1m]\x1b[0m {}", '+', line);
 }
 
+pub fn debug(line: &str) {
+    println!("\x1b[2K\x1b[1m[\x1b[34m{}\x1b[0;1m]\x1b[0m {}", '#', line);
+}
+
 pub fn warn(line: &str) {
     eprintln!("\x1b[1m[\x1b[33m{}\x1b[0;1m]\x1b[0m {}", '!', line);
 }
@@ -235,6 +245,11 @@ impl SpinLogger for StackedSpinners {
         println!("\r\x1b[2K\x1b[1m[\x1b[34m{}\x1b[0;1m]\x1b[0m {}", '*', line);
     }
 
+    fn debug(&mut self, line: &str) {
+        self.jump2start();
+        println!("\r\x1b[2K\x1b[1m[\x1b[34m{}\x1b[0;1m]\x1b[0m {}", '#', line);
+    }
+
     fn error(&mut self, line: &str) {
         self.jump2start();
         println!("\r\x1b[2K\x1b[1m[\x1b[31m{}\x1b[0;1m]\x1b[0m {}", '-', line);
@@ -264,6 +279,10 @@ impl<'a, T: SpinLogger> SpinLogger for PrefixedLogger<'a, T> {
         self.s.log(&format!("{:50}: {}", self.prefix, line))
     }
 
+    fn debug(&mut self, line: &str) {
+        self.s.debug(&format!("{:50}: {}", self.prefix, line))
+    }
+
     fn error(&mut self, line: &str) {
         self.s.error(&format!("{:50}: {}", self.prefix, line))
     }
diff --git a/src/web.rs b/src/web.rs
index 0734c244..9ef32d4b 100644
--- a/src/web.rs
+++ b/src/web.rs
@@ -202,8 +202,7 @@ impl HttpRequest {
         // send request
         debug!("Sending http request: {:?}", req);
 
-        let config = state.dns_config().as_ref().clone();
-        let resolver = Resolver::from_config(config)?;
+        let resolver = state.dns_config().as_ref().clone();
         let mut http = Client::new(resolver);
 
         if let Some(timeout) = self.timeout {
diff --git a/src/worker.rs b/src/worker.rs
index f76d9b69..ff750217 100644
--- a/src/worker.rs
+++ b/src/worker.rs
@@ -74,6 +74,7 @@ pub enum ExitEvent {
 #[derive(Debug, Serialize, Deserialize)]
 pub enum LogEvent {
     Info(String),
+    Debug(String),
     Error(String),
     Status(String),
 }
@@ -82,6 +83,7 @@ impl LogEvent {
     pub fn apply<T: SpinLogger>(self, spinner: &mut T) {
         match self {
             LogEvent::Info(info) => spinner.log(&info),
+            LogEvent::Debug(debug) => spinner.debug(&debug),
             LogEvent::Error(error) => spinner.error(&error),
             LogEvent::Status(status) => spinner.status(status),
         }
@@ -96,11 +98,16 @@ pub enum DatabaseEvent {
 }
 
 impl DatabaseEvent {
-    pub fn apply<T: SpinLogger>(self, tx: DbSender, spinner: &mut T, db: &Database) {
+    pub fn apply<T: SpinLogger>(self, tx: DbSender, spinner: &mut T, db: &Database, verbose: u64) {
         match self {
             DatabaseEvent::Insert(object) => {
+                if verbose >= 1 {
+                    spinner.debug(&format!("Inserting: {:?}", object));
+                }
+
                 let result = db.insert_generic(&object);
                 debug!("{:?} => {:?}", object, result);
+
                 let result = match result {
                     Ok(Some((DbChange::Insert, id))) => {
                         // TODO: replace id with actual object(?)
@@ -134,6 +141,10 @@ impl DatabaseEvent {
                 tx.send(result).expect("Failed to send db result to channel");
             },
             DatabaseEvent::Update((object, update)) => {
+                if verbose >= 1 {
+                    spinner.debug(&format!("Updating: {:?}", update));
+                }
+
                 let result = db.update_generic(&update);
                 debug!("{:?}: {:?} => {:?}", object, update, result);
                 let result = result
@@ -153,7 +164,7 @@ impl DatabaseEvent {
     }
 }
 
-pub fn spawn(rl: &mut Readline, module: &Module, args: Vec<(serde_json::Value, Option<String>)>, threads: usize) {
+pub fn spawn(rl: &mut Readline, module: &Module, args: Vec<(serde_json::Value, Option<String>)>, threads: usize, verbose: u64) {
     // This function hangs if args is empty, so return early if that's the case
     if args.is_empty() {
         return;
@@ -183,7 +194,7 @@ pub fn spawn(rl: &mut Readline, module: &Module, args: Vec<(serde_json::Value, O
             }
 
             tx.send(Event2::Start);
-            let event = match engine::isolation::spawn_module(module, &tx, arg) {
+            let event = match engine::isolation::spawn_module(module, &tx, arg, verbose) {
                 Ok(_) => ExitEvent::Ok,
                 Err(err) => ExitEvent::Err(err.to_string()),
             };
@@ -206,7 +217,7 @@ pub fn spawn(rl: &mut Readline, module: &Module, args: Vec<(serde_json::Value, O
                             stack.add(name, label);
                         },
                         Event2::Log(log) => log.apply(&mut stack.prefixed(name)),
-                        Event2::Database((db, tx)) => db.apply(tx, &mut stack.prefixed(name), rl.db()),
+                        Event2::Database((db, tx)) => db.apply(tx, &mut stack.prefixed(name), rl.db(), verbose),
                         Event2::Exit(event) => {
                             stack.remove(&name);
                             if let ExitEvent::Err(error) = event {


Test patch: