Add extended forward zone type for overriding public domain records
An extended zone answers authoritatively only for the records it holds locally; any name with nothing configured falls through to recursive resolution instead of a synthesized NXDOMAIN, so a public domain's records don't need to be duplicated just to override a few of them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V8c76Xr2BycaHHu5N4buqi
This commit is contained in:
@@ -12,17 +12,29 @@ const (
|
||||
ZoneForward ZoneKind = "forward"
|
||||
ZoneReverse4 ZoneKind = "reverse4"
|
||||
ZoneReverse6 ZoneKind = "reverse6"
|
||||
// ZoneExtended is a forward zone that is authoritative only for the
|
||||
// records it explicitly holds. Any name it has no local data for falls
|
||||
// through to recursive resolution instead of being answered NXDOMAIN, so
|
||||
// it can be used to override a handful of records in an otherwise public
|
||||
// domain without duplicating that domain's entire record set.
|
||||
ZoneExtended ZoneKind = "extended"
|
||||
)
|
||||
|
||||
// Valid reports whether k is a kind the application understands.
|
||||
func (k ZoneKind) Valid() bool {
|
||||
switch k {
|
||||
case ZoneForward, ZoneReverse4, ZoneReverse6:
|
||||
case ZoneForward, ZoneReverse4, ZoneReverse6, ZoneExtended:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsForward reports whether k belongs on the forward-zone side of the UI
|
||||
// (as opposed to the reverse-zone side).
|
||||
func (k ZoneKind) IsForward() bool {
|
||||
return k == ZoneForward || k == ZoneExtended
|
||||
}
|
||||
|
||||
// Label returns a human readable name for the zone kind.
|
||||
func (k ZoneKind) Label() string {
|
||||
switch k {
|
||||
@@ -30,6 +42,8 @@ func (k ZoneKind) Label() string {
|
||||
return "Reverse IPv4"
|
||||
case ZoneReverse6:
|
||||
return "Reverse IPv6"
|
||||
case ZoneExtended:
|
||||
return "Extended"
|
||||
default:
|
||||
return "Forward"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user