Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document behavior of dns section. #2165

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions llarp/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,11 @@ namespace llarp
DnsConfig::defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params)
{
(void)params;
conf.addSectionComments(
"dns",
{"This section is responsible for setting up dns subsystem."
"Any config items suffixed with a key suffixed with ':' (e.g. dns-cache-max:= 6000) are "
"forwarded to libunbound when it is configured on startup."});

// Most non-linux platforms have loopback as 127.0.0.1/32, but linux uses 127.0.0.1/8 so that we
// can bind to other 127.* IPs to avoid conflicting with something else that may be listening on
Expand Down Expand Up @@ -893,6 +898,9 @@ namespace llarp

// forward the rest to libunbound
conf.addUndeclaredHandler("dns", [this](auto, std::string_view key, std::string_view val) {
if (not ends_with(key, ":"))
throw std::invalid_argument{"Invalid option provided in dns config: '{}'"_format(key)};

m_ExtraOpts.emplace(key, val);
});
}
Expand Down