Comparison

util/prosodyctl/check.lua @ 11645:3be346c5b940

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.
author Kim Alvefur <zash@zash.se>
date Sat, 03 Jul 2021 03:24:26 +0200
parent 11635:1b17b967838e
child 11651:c9f46d28ed7e
comparison
equal deleted inserted replaced
11644:fc1b8fe94d04 11645:3be346c5b940
297 print("Done.\n"); 297 print("Done.\n");
298 end 298 end
299 if not what or what == "dns" then 299 if not what or what == "dns" then
300 local dns = require "net.dns"; 300 local dns = require "net.dns";
301 pcall(function () 301 pcall(function ()
302 local unbound = require"net.unbound";
302 local unbound_config = configmanager.get("*", "unbound") or {}; 303 local unbound_config = configmanager.get("*", "unbound") or {};
303 unbound_config.hoststxt = false; -- don't look at /etc/hosts 304 unbound_config.hoststxt = false; -- don't look at /etc/hosts
304 configmanager.set("*", "unbound", unbound_config); 305 configmanager.set("*", "unbound", unbound_config);
305 dns = require"net.unbound".dns; 306 unbound.purge(); -- ensure the above config is used
307 dns = unbound.dns;
306 end) 308 end)
307 local idna = require "util.encodings".idna; 309 local idna = require "util.encodings".idna;
308 local ip = require "util.ip"; 310 local ip = require "util.ip";
309 local c2s_ports = set.new(configmanager.get("*", "c2s_ports") or {5222}); 311 local c2s_ports = set.new(configmanager.get("*", "c2s_ports") or {5222});
310 local s2s_ports = set.new(configmanager.get("*", "s2s_ports") or {5269}); 312 local s2s_ports = set.new(configmanager.get("*", "s2s_ports") or {5269});