72c86c105a7cf315036d7131a4ef408bc6227639Evan HuntThe "wildcard" DLZ module provides a "template" zone for domains matching
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunta wildcard name. For example, the following DLZ configuration would match
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntany zone name containing the string "example" and ending with .com, such
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntas "thisexample.com", "exampleofthat.com", or "anexampleoftheotherthing.com".
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt dlz "test" {
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt database "dlopen ../dlz_wildcard_dynamic.so
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt *example*.com 10.53.* 1800
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt @ 3600 SOA {ns3.example.nil. support.example.nil. 42 14400 7200 2592000 600}
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt @ 3600 NS ns3.example.nil.
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt @ 3600 NS ns4.example.nil.
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt @ 3600 NS ns8.example.nil.
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt @ 3600 MX {5 mail.example.nil.}
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt ftp 86400 A 192.0.0.1
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt sql 86400 A 192.0.0.2
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt tmp {} A 192.0.0.3
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt www 86400 A 192.0.0.3
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt www 86400 AAAA ::1
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt txt 300 TXT {\"you requested $record$ in $zone$\"}
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * 86400 A 192.0.0.100";
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt };
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan HuntFor any zone name matchin the wildcard, it would return the data from
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntthe template. "$zone$" is replaced with zone name: i.e., the shortest
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntpossible string of labels in the query name that matches the wildcard.
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt"$record$" is replaced with the remainder of the query name. In the
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntexample above, a query for "txt.thisexample.com/TXT" would return the
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntstring "you requested txt in thisexample.com".
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan HuntAny client whose source address matches the second wildcard ("10.53.*")
72c86c105a7cf315036d7131a4ef408bc6227639Evan Huntis allowed to request a zone transfer.