From 99dcf5d9f792d8a38b715cf6d945c1e98d792f08 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 20 Jun 2021 17:51:44 +0200 Subject: util.prosodyctl.check: Ensure that libunbound does not check hosts file This fixes wrongly reported DNS problems on some distros where the hosts file contains an entry for the local machine, pointing at a loopback address such as 127.0.1.1 or similar. --- util/prosodyctl/check.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util/prosodyctl') diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua index dc821ce1..dcb07c8f 100644 --- a/util/prosodyctl/check.lua +++ b/util/prosodyctl/check.lua @@ -228,6 +228,9 @@ local function check(arg) if not what or what == "dns" then local dns = require "net.dns"; pcall(function () + 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; end) local idna = require "util.encodings".idna; -- cgit v1.2.3