util.prosodyctl.check: Use net.unbound for DNS if available
authorKim Alvefur <zash@zash.se>
Thu, 25 Jun 2020 19:28:51 +0200
changeset 10975 3cdb4a7cb406
parent 10974 4603697aee50
child 10976 b3773b1b90a1
util.prosodyctl.check: Use net.unbound for DNS if available Improves performance somewhat by avoiding the rate limiting in net.dns
util/prosodyctl/check.lua
--- a/util/prosodyctl/check.lua	Thu Jun 25 19:24:58 2020 +0200
+++ b/util/prosodyctl/check.lua	Thu Jun 25 19:28:51 2020 +0200
@@ -225,6 +225,9 @@
 	end
 	if not what or what == "dns" then
 		local dns = require "net.dns";
+		pcall(function ()
+			dns = require"net.unbound".dns;
+		end)
 		local idna = require "util.encodings".idna;
 		local ip = require "util.ip";
 		local c2s_ports = set.new(configmanager.get("*", "c2s_ports") or {5222});