Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
11616:cd4006709493 | 11617:166f8e1d82b0 |
---|---|
226 print("Done.\n"); | 226 print("Done.\n"); |
227 end | 227 end |
228 if not what or what == "dns" then | 228 if not what or what == "dns" then |
229 local dns = require "net.dns"; | 229 local dns = require "net.dns"; |
230 pcall(function () | 230 pcall(function () |
231 local unbound_config = configmanager.get("*", "unbound") or {}; | |
232 unbound_config.hoststxt = false; -- don't look at /etc/hosts | |
233 configmanager.set("*", "unbound", unbound_config); | |
231 dns = require"net.unbound".dns; | 234 dns = require"net.unbound".dns; |
232 end) | 235 end) |
233 local idna = require "util.encodings".idna; | 236 local idna = require "util.encodings".idna; |
234 local ip = require "util.ip"; | 237 local ip = require "util.ip"; |
235 local c2s_ports = set.new(configmanager.get("*", "c2s_ports") or {5222}); | 238 local c2s_ports = set.new(configmanager.get("*", "c2s_ports") or {5222}); |