util.dependencies: Prefer net.unbound over net.adns
authorKim Alvefur <zash@zash.se>
Thu, 25 Jun 2020 17:41:07 +0200
changeset 10969 f5d5fc409680
parent 10968 d6a3d652ca32
child 10970 97de279ca01a
util.dependencies: Prefer net.unbound over net.adns
util/dependencies.lua
--- a/util/dependencies.lua	Thu Jun 25 17:26:58 2020 +0200
+++ b/util/dependencies.lua	Thu Jun 25 17:41:07 2020 +0200
@@ -104,6 +104,11 @@
 				{ "luarocks", "luarocks install luaunbound" };
 				{ "Source", "https://www.zash.se/luaunbound.html" };
 			}, "Old DNS resolver library will be used", err);
+	else
+		package.preload["net.adns"] = function ()
+			local ub = require "net.unbound";
+			return ub;
+		end
 	end
 
 	local encodings, err = softreq "util.encodings"