Mercurial > prosody-hg
comparison net/unbound.lua @ 14215:2719dbb358c8
net.unbound: Briefly explain default override settings
resolvconf=true is the default in luaunbound, so technically redundant,
but an excuse to remove that comment and add some better ones.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 07 Jun 2026 18:23:24 +0200 |
| parents | 41fa97090264 |
| children | 2ec517d8d43e |
comparison
equal
deleted
inserted
replaced
| 14214:3870f944dec4 | 14215:2719dbb358c8 |
|---|---|
| 23 | 23 |
| 24 local dns_utils = require"prosody.util.dns"; | 24 local dns_utils = require"prosody.util.dns"; |
| 25 local classes, types, errors = dns_utils.classes, dns_utils.types, dns_utils.errors; | 25 local classes, types, errors = dns_utils.classes, dns_utils.types, dns_utils.errors; |
| 26 local parsers = dns_utils.parsers; | 26 local parsers = dns_utils.parsers; |
| 27 | 27 |
| 28 local builtin_defaults = { hoststxt = false } | 28 local builtin_defaults = { |
| 29 -- Continue net.dns tradition of not reading /etc/hosts which does not fit well with SRV records anyway | |
| 30 hoststxt = false; | |
| 31 -- net.dns did read /etc/resolv.conf and we want libunbound to instead of operating in recursive mode | |
| 32 resolvconf = true; | |
| 33 } | |
| 29 | 34 |
| 30 local function add_defaults(conf) | 35 local function add_defaults(conf) |
| 31 conf = conf or {}; | 36 conf = conf or {}; |
| 32 for option, default in pairs(builtin_defaults) do | 37 for option, default in pairs(builtin_defaults) do |
| 33 if conf[option] == nil then | 38 if conf[option] == nil then |
| 41 end | 46 end |
| 42 return conf; | 47 return conf; |
| 43 end | 48 end |
| 44 | 49 |
| 45 local unbound_config; | 50 local unbound_config; |
| 46 -- Note: libunbound will default to using root hints if resolvconf is unset | |
| 47 | 51 |
| 48 local function connect_server(unbound, server) | 52 local function connect_server(unbound, server) |
| 49 log("debug", "Setting up net.server event handling for %s", unbound); | 53 log("debug", "Setting up net.server event handling for %s", unbound); |
| 50 return server.watchfd(unbound, function () | 54 return server.watchfd(unbound, function () |
| 51 log("debug", "Processing queries for %s", unbound); | 55 log("debug", "Processing queries for %s", unbound); |
