diff --git a/octodns/record/__init__.py b/octodns/record/__init__.py index 04eb2da..849e035 100644 --- a/octodns/record/__init__.py +++ b/octodns/record/__init__.py @@ -1209,7 +1209,7 @@ class SrvValue(EqualityTupleMixin): class SrvRecord(_ValuesMixin, Record): _type = 'SRV' _value_type = SrvValue - _name_re = re.compile(r'^_[^\.]+\.[^\.]+') + _name_re = re.compile(r'^(\*|_[^\.]+)\.[^\.]+') @classmethod def validate(cls, name, fqdn, data): diff --git a/tests/test_octodns_record.py b/tests/test_octodns_record.py index e2917b3..08a3e7a 100644 --- a/tests/test_octodns_record.py +++ b/tests/test_octodns_record.py @@ -2155,6 +2155,18 @@ class TestRecordValidation(TestCase): } }) + # permit wildcard entries + Record.new(self.zone, '*._tcp', { + 'type': 'SRV', + 'ttl': 600, + 'value': { + 'priority': 1, + 'weight': 2, + 'port': 3, + 'target': 'food.bar.baz.' + } + }) + # invalid name with self.assertRaises(ValidationError) as ctx: Record.new(self.zone, 'neup', {