About
This repo contains a lua script for PowerDNS Recursor and a sample test setup.
The script implements a "recursive cname" function. With a specified "recursive subdomain", e.g. "re.example.com", all names in that subdomain (e.g. "a.b.re.example.com") are handled as follows:
- "name" part is extracted from the query (e.g. "a.b")
- if "name" part is an IPv4 address, return that address for type A query, and nodata for all other types
- else return a CNAME record pointing to "name" part as a domain (e.g. "a.b.")
The DNS64 version is NOT usable.
Test
cd subdomain-recur-cname/
pdns_recursor --config-dir=test
# pdns_recursor --config-dir=test-dns64
dig -p 5333 @::1 A www.google.com.re.example.com
dig -p 5333 @::1 AAAA www.google.com.re.example.com
dig -p 5333 @::1 A 1.1.1.1.re.example.com
dig -p 5333 @::1 AAAA 1.1.1.1.re.example.com
dig -p 5333 @::1 A 1.1.1.1111.re.example.com