From 9cda38bbc7ef5debbbdfba267a430d621e6da3d0 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Thu, 30 Jun 2022 12:03:26 +0000 Subject: dns: T4378: Allow wildcard A AAAA record with option any Ability to set wildcard record for authoritative-domain set authoritative-domain example.com records a any address 192.0.2.11 cat /run/powerdns/zone.example.com.conf * 300 A 192.0.2.11 --- interface-definitions/dns-forwarding.xml.in | 12 ++++++++++-- src/conf_mode/dns_forwarding.py | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/interface-definitions/dns-forwarding.xml.in b/interface-definitions/dns-forwarding.xml.in index 12dc11de5..baff4a841 100644 --- a/interface-definitions/dns-forwarding.xml.in +++ b/interface-definitions/dns-forwarding.xml.in @@ -133,8 +133,12 @@ @ Root record + + any + Wildcard record (any subdomain) + - ([-_a-zA-Z0-9.]{1,63}|@)(?<!\.) + ([-_a-zA-Z0-9.]{1,63}|@|any)(?<!\.) @@ -166,8 +170,12 @@ @ Root record + + any + Wildcard record (any subdomain) + - ([-_a-zA-Z0-9.]{1,63}|@)(?<!\.) + ([-_a-zA-Z0-9.]{1,63}|@|any)(?<!\.) diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py index f1c2d1f43..41023c135 100755 --- a/src/conf_mode/dns_forwarding.py +++ b/src/conf_mode/dns_forwarding.py @@ -98,6 +98,9 @@ def get_config(config=None): dns['authoritative_zone_errors'].append('{}.{}: at least one address is required'.format(subnode, node)) continue + if subnode == 'any': + subnode = '*' + for address in rdata['address']: zone['records'].append({ 'name': subnode, -- cgit v1.2.3