Diff

util/prosodyctl/check.lua @ 11617:166f8e1d82b0

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.
author Kim Alvefur <zash@zash.se>
date Sun, 20 Jun 2021 17:51:44 +0200
parent 11616:cd4006709493
child 11634:a6c87b4c0cdf
line wrap: on
line diff
--- a/util/prosodyctl/check.lua	Sun Jun 20 17:34:50 2021 +0200
+++ b/util/prosodyctl/check.lua	Sun Jun 20 17:51:44 2021 +0200
@@ -228,6 +228,9 @@
 	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;