#
#
#
from .base import Record, ValueMixin
from .target import _TargetValue
from .validator import RecordValidator
[docs]
class AliasValue(_TargetValue):
pass
[docs]
class AliasRootValidator(RecordValidator):
'''
Restricts ALIAS records to the zone root — the non-standard ALIAS
type only has meaning at the apex.
'''
[docs]
def validate(self, record_cls, name, fqdn, data):
if name != '':
return ['non-root ALIAS not allowed']
return []
[docs]
class AliasRecord(ValueMixin, Record):
REFERENCES = ('https://datatracker.ietf.org/doc/draft-ietf-dnsop-aname/',)
_type = 'ALIAS'
_value_type = AliasValue
VALIDATORS = [AliasRootValidator('alias-root', sets={'legacy', 'strict'})]
Record.register_type(AliasRecord)