Fix the negative-caching warning and show warnings in the CLI

The soa_warning for negative caching fired on the SOA minimum alone and
blamed BIND's resolver cap (max-ncache-ttl), which doesn't apply to an
authoritative zone. Resolvers cache negative answers for the smaller of
the SOA minimum and the SOA record's TTL (RFC 2308 section 5), and the
SOA record uses the zone's default TTL. The warning now uses that value,
explains the effect, and suggests the fix command (with --view when the
zone is in a view).

Also:
- Problem.String shows zone names without the trailing dot (jarld check).
- jarl prints the warnings a change introduces when it is applied or
  staged, not only on dry runs.
- jarl check/resync print only named-checkconf errors, not its
  "loaded serial" lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-07 15:29:05 +00:00
1 parent bd6b8778e4
commit 3c73afe0e1
7 files changed
+89 -11

No files matched your search

+1 -7
View File
@@ -206,13 +206,7 @@ func printResult(r *client.Result, ok string) error {
fmt.Println("error:", r.Error.Message)
}
printProblems(os.Stdout, r.Problems)
for _, m := range r.Check {
obj := ""
if m.Object != "" {
obj = " [" + m.Object + "]"
}
fmt.Printf(" named-checkconf: %s%s\n", m.Text, obj)
}
printCheck(os.Stdout, r.Check) // errors only, not "loaded serial" lines
for _, w := range r.Warnings {
fmt.Println("warning:", w)
}
+9
View File
@@ -343,6 +343,15 @@ func report(resp *api.MutationResponse) error {
}
fmt.Fprintf(w, "applied (changeset %d)\n", r.ChangesetID)
}
// Warnings the change introduced (errors would have blocked it).
var introduced []client.Problem
switch {
case resp.Applied && r != nil:
introduced = r.Problems
case resp.Staged && len(resp.Problems) > 0:
json.Unmarshal(resp.Problems, &introduced)
}
printProblems(os.Stderr, introduced)
for _, warn := range resp.Warnings {
fmt.Fprintln(os.Stderr, "warning:", warn)
}