A single-label query is answered from the host names DHCP registered in DNS #137
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Depends on
Reference
lantea-one/ninlil#137
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
The owner chose to answer bare names from DHCP-registered names first. The data exists: for an active lease with a usable host name,
DhcpDnsRegistrationServicewrites an A (or AAAA) record named<label>.<zone>in the zone of the scope'sDnsZoneId, markedManagedByFeature = Dhcp(src/dotnet/src/Ninlil.Dhcp.Server.DnsIntegration/DhcpDnsRegistrationService.cs:154-161,:403-429). It removes the record when the lease ends (:142-151) and refuses names that clash with static records or a live client (:164-217). Those records are in memory inAuthoritativeZoneCache, andCachedZone.GetRecordsreturnsRecordEntityrows withManagedByFeature(src/dotnet/src/Ninlil.Dns.Server.Authoritative/Cache/CachedZone.cs:165-178).Technical call: answer from these registered records, not from lease host names. They already apply the conflict rules (static wins, a live client keeps its name, and the per-scope host-name policy of #186), they expire with the lease, and they cost no database read per query. A scope without a
DnsZoneIdregisters nothing, so its clients are not answered by this source; README says so.What changes
src/dotnet/src/Ninlil.Dhcp.Server.DnsIntegration/DhcpRegisteredHostNameSource.cs(new), implementingILocalHostNameSource(#136) withOrder = LocalHostNameSourceOrder.DhcpRegisteredNames(first):RefreshingSnapshotof the DHCP scopes that have aDnsZoneIdof an eligible type (DhcpDnsRegistrationService.IsEligibleZoneType,:351): zone name, protocol and address range. It expires onIEntityChangeNotifierforDhcpScopeEntityandZoneEntity, with a 60 s time-to-live like the other snapshots.nas: zones in order, the zone of a scope whose range holds the client's address first, then the rest by zone name. For each,AuthoritativeZoneCache.FindZone("nas.<zone>")thenGetRecords("nas.<zone>"), keeping only records withManagedByFeature == Dhcpof type A or AAAA. The first zone with any such record wins.nas.<zone>are not used by this source; the local domain (#138) answers them, after the hosts files.ServiceCollectionDhcpDnsIntegrationExtension: register it as anILocalHostNameSource. The integration is registered in every configuration (src/dotnet/src/Ninlil.Web/Startup/DhcpServiceRegistration.cs:78-85), so the source is always present and simply finds nothing without DHCP zones.AnswerSource = Authoritative,Upstream = null.Acceptance
src/dotnet/tests/Ninlil.Dhcp.Server.DnsIntegration.Tests: zonelanholds DHCP-managednas.lan A 192.168.1.20;FindAsync("nas", A, client)returns one A recordnas 300 A 192.168.1.20.naswith only an A record gives "exists, no records" (NODATA).printer.langives not found from this source.nasregistered in zonesa.lanandb.lan, a client inside the scope ofb.langets theb.lanaddress.nasis not found.OrderequalsLocalHostNameSourceOrder.DhcpRegisteredNames.src/dotnet/tests/Ninlil.Web.Testspasses (DI wiring). No schema, API or option change.Source