Web UI: zone naming and reverse zones, ACL suggestions, record form
- New zone dialog: choose Domain or Reverse zone. Reverse zones are created from a network and their name is generated; both kinds show the exact zone name and flag likely mistakes (addresses or URLs as names, host-like names, duplicates in the view, parent/child zones, networks off the octet/nibble boundaries) before anything is submitted. - Record form: clears every field but the type after an add; shows the record exactly as it will be stored and warns about unqualified names. In reverse zones it takes an address, defaults to PTR, suggests host names of A/AAAA records with that address and warns about a second PTR; the record list shows addresses. - Address match lists (options, view match lists, ACL elements) offer the existing ACLs, TSIG keys and built-ins as one-click suggestions and flag unknown names. - Server: in reverse zones a record can be named by its address, and a PTR target like nas.example.com without the final dot is read as the full host name (a bare label is refused). Warnings noticed while parsing record data reach the result again. - Fixes: brand link hover underline, the dashboard's "New zone" link opening the dialog twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b7bee67f8
commit
bf7f99874b
19 files changed
+577
-35
No files matched your search
@@ -202,6 +202,16 @@ func Parse(zone, owner, typ, data string) (*Parsed, error) {
|
||||
if IsTextType(t) && !strings.HasPrefix(d, `"`) {
|
||||
d = QuoteText(d)
|
||||
}
|
||||
// A PTR record names a host, which is never inside the reverse zone
|
||||
// itself: "nas.adbraun.lol" means the absolute name.
|
||||
var ptrWarning string
|
||||
if t == "PTR" && dnsname.IsReverse(zone) && !strings.HasSuffix(d, ".") && !strings.ContainsAny(d, " \t") {
|
||||
if !strings.Contains(d, ".") {
|
||||
return nil, fmt.Errorf("PTR data %q would become %s%s; give the host's full name, e.g. %s.example.com", d, d+".", zone, d)
|
||||
}
|
||||
ptrWarning = fmt.Sprintf("%q was read as the absolute name %q (add a trailing dot to be explicit)", d, d+".")
|
||||
d += "."
|
||||
}
|
||||
typeText := t
|
||||
if _, known := dns.TypeToString[code]; !known {
|
||||
typeText = fmt.Sprintf("TYPE%d", code)
|
||||
@@ -226,6 +236,9 @@ func Parse(zone, owner, typ, data string) (*Parsed, error) {
|
||||
return nil, fmt.Errorf("data does not form a %s record", t)
|
||||
}
|
||||
p := &Parsed{RR: parsed, Type: t}
|
||||
if ptrWarning != "" {
|
||||
p.Warnings = append(p.Warnings, ptrWarning)
|
||||
}
|
||||
if err := p.fixNames(zone, data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user