util.prosodyctl.check: Reload unbound to ensure hosts.txt is ignored
If unbound was initialized prior to this then the config change here
wouldn't apply, and it will again think that 127.0.1.1 has been found
in DNS.
--- a/util/prosodyctl/check.lua Tue Jun 29 16:18:31 2021 +0200
+++ b/util/prosodyctl/check.lua Sat Jul 03 03:24:26 2021 +0200
@@ -299,10 +299,12 @@
if not what or what == "dns" then
local dns = require "net.dns";
pcall(function ()
+ local unbound = require"net.unbound";
local unbound_config = configmanager.get("*", "unbound") or {};
unbound_config.hoststxt = false; -- don't look at /etc/hosts
configmanager.set("*", "unbound", unbound_config);
- dns = require"net.unbound".dns;
+ unbound.purge(); -- ensure the above config is used
+ dns = unbound.dns;
end)
local idna = require "util.encodings".idna;
local ip = require "util.ip";