Skip to content

Commit

Permalink
Make CNAME '@' values absolute
Browse files Browse the repository at this point in the history
If a CNAME has an '@' value, octoDNS will complain about an invalid
record because the value is missing a trailing dot. Since NetBox DNS
doesn't support adding a trailing dot after '@', this value must be
absolute, regardless of the configuration of the 'make_absolute'
setting.
  • Loading branch information
alehaa committed Jan 8, 2025
1 parent 173b76e commit d75568d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/octodns_netbox_dns/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ def _format_nb_records(self, zone: octodns.zone.Zone) -> list[dict[str, Any]]:
)
for nb_record in nb_records:
rcd_name: str = "" if nb_record.name == "@" else nb_record.name
rcd_value: str = nb_record.zone.name if nb_record.value == "@" else nb_record.value
rcd_value: str = (
self._make_absolute(nb_record.zone.name, True)
if nb_record.value == "@"
else nb_record.value
)
rcd_type: str = nb_record.type
rcd_ttl: int = nb_record.ttl or nb_zone.default_ttl
if nb_record.type == "NS":
Expand Down

0 comments on commit d75568d

Please sign in to comment.