Multi-level wildcard (catch-all) DNS setup *.*.domain.com => one IP/CNAME
On any real DNS server a wildcard record will match one or more labels.
See section 4.3.3 of RFC 1034.
Works in bind with just a record for *.dig.foo.com
, it will grab anything under that domain. I.e. dog.cat.dig.foo.com
Edit:
This is a sample configuration file.
BIND 9.2.4 and the zone file content is
$ORIGIN test.domain.com.
* CNAME proxyserver.domain.com.
$ORIGIN domain.com.
....
We use multi level subdomains on our CDNs. In our DNS control panel (Zerigo) we just used *.ourcdn.com mapping to a CName of our CDN. Then we can use
node1.site1.ourcdn.com
node2.site1.ourcdn.com
node1.site2.ourcdn.com
node2.site2.ourcdn.com
I haven't had a chance to test this on BIND etc. but I'm fairly certain it will work the same in there, Zerigo responsds with
*.ourcdn.com. IN CNAME cdnsource.com