Ninlil answers names from a configurable list of hosts files and reloads them when they change #173
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lantea-one/ninlil#173
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Nothing reads a hosts file for resolution.
DnsFilterListParser(src/dotnet/src/Ninlil.Dns.Server.Filtering/DnsFilterListParser.cs:88-226) reads the hosts format only to build block lists. The owner wants a list of hosts files that Ninlil answers from directly, the way a common lightweight DNS forwarder's "additional hosts" option works. The behaviour below comes from that tool's public manual page only, never its source, and the tool is not named in code, docs or commits.What changes
The design, so every child agrees:
HostsFilesOptions(sectionDnsServer:HostsFiles):Paths: a list of absolute paths, empty by default (R2-HOSTS-DEF). A path to a directory means every regular file directly in it, read in name order (not recursive).ExpandDomain: a domain, or empty for off. When set, a bare name (no dot) in a file also answers as<name>.<ExpandDomain>.TimeToLiveSeconds: default 60 (R2-HOSTS-DEF).PollInterval: default 30 seconds.Pathsmeans a new install answers nothing from/etc/hostsuntil the operator adds it. Ninlil's own host file would otherwise publishlocalhostand the machine's private names to the LAN. The README shows how to add/etc/hosts.Pathsis a list, so it has no environment variable (AGENTS.md "Configuration"); the other three have.#comments). The result is one immutable table swapped in atomically, so a query never sees a half-loaded table.PollInterval. Technical call: watchers miss events on network file systems and some bind mounts, so the poll is the guarantee and the watcher only makes it faster.IDnsQueryResolver, registered after the authoritative resolvers and before forwarding (Program.cs:496-503):<name>.<ExpandDomain>forms included).in-addr.arpaandip6.arpa(RFC 1035 §3.5, RFC 3596 §2.5) answers the first name listed for that address, in path-list order; withExpandDomainset, a bare name answers as its expanded form.DnsQueryProcessingPipeline.cs:56-63), so block lists and rewrites still apply, and an authoritative zone the operator hosts wins over a hosts file.LocalHostNameSourceOrder.HostsFiles): DHCP-registered names (#137) first, then the hosts files, then the local domain (#138), then NXDOMAIN (or upstream when single-label protection is off). So a DHCP client's registered name wins over a stale hosts entry, as the owner ordered.Children: #174 (loader), #175 (resolver and bare-name source), #176 (settings and status API), #177 (api-regen), #178 (console).
Acceptance
/etc/hostsand a directory, domain expansion and how it differs from the DNS hygiene "local domain" (#138), the bare-name order, reload behaviour, precedence against zones and rewrites, and the Windows path (C:\Windows\System32\drivers\etc\hosts).Source
audit-feature-parity.md§2A #15; DEDUPE.md §2 and P6.Owner decision 2026-10-31: "configure it like dnsmasq with multiple hosts file support" = a configurable list of hosts-file paths, read on start and reloaded on change, answering A/AAAA and PTR, optional domain expansion for bare names; it replaces the import-to-rewrites design (Q-PN-11).
Owner decisions 2026-10-31, round 2: bare-name order DHCP names, hosts files, local domain, NXDOMAIN (R2-BARE); empty list by default, 60 s TTL (R2-HOSTS-DEF); hosts files stay in this milestone (R2-MS-HOSTS).