From 943b7419b875d405fa1edf47d21d76108c2fe1aa Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 3 Jul 2021 03:24:26 +0200 Subject: 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. --- util/prosodyctl/check.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'util') diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua index ec67b31f..4a25fc1b 100644 --- a/util/prosodyctl/check.lua +++ b/util/prosodyctl/check.lua @@ -299,10 +299,12 @@ local function check(arg) 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"; -- cgit v1.2.3