octodns.record.cname

Classes

CnameRecord(zone, name, data, *args, **kwargs)

CnameRootValidator(id[, sets])

Rejects CNAME records at the zone root, which are prohibited by RFC 1034/2181.

CnameValue(v)

class octodns.record.cname.CnameValue(v)[source]

Bases: _TargetValue

class octodns.record.cname.CnameRootValidator(id, sets=None)[source]

Bases: RecordValidator

Rejects CNAME records at the zone root, which are prohibited by RFC 1034/2181.

validate(record_cls, name, fqdn, data)[source]

Validate a record’s non-value attributes.

Parameters:
  • record_cls (type) – The concrete Record subclass being validated. Validators that need access to record class-level attributes (e.g. _type, _value_type) should read them from record_cls. Per-instance configuration should live on self, not on record_cls.

  • name (str) – The record’s name relative to its zone ('' for the zone root). Already idna_encode’d.

  • fqdn (str) – The record’s fully-qualified domain name (name + zone name).

  • data (dict) – The raw record config dict (as loaded from YAML/JSON) including ttl, type, value/values, and any type-specific fields like dynamic, geo, or octodns.

Returns:

A list of human-readable reason strings describing validation failures. Must return an empty list when the record is valid. Reasons from multiple validators are concatenated by the caller, so each reason must stand alone without context from the others.

Return type:

list[str]

Notes

Implementations must not raise on invalid input — all failures are reported via the returned list. Reason strings are surfaced verbatim in ValidationError messages, so phrasing and punctuation should be stable across releases.

class octodns.record.cname.CnameRecord(zone, name, data, *args, **kwargs)[source]

Bases: _DynamicMixin, ValueMixin, Record

REFERENCES = ('https://datatracker.ietf.org/doc/html/rfc1035',)
_type = 'CNAME'
_value_type

alias of CnameValue

VALIDATORS = [<octodns.record.cname.CnameRootValidator object>]