By Ismar Kunc
Hello,
I have four subdomains. First two subdomains are set with wildcard *.static.MYSITE.com and .*v2.MYSITE.COM Another two subdomains are set without wildcard test.z3lab.info, cms.z3lab.info
Which subdomains are more correct, and why do we use wildcard?
This is my zone file
$ORIGIN z3lab.info.
$TTL 1800
z3lab.info. IN SOA ns1.digitalocean.com. hostmaster.z3lab.info. 1472229537 10800 3600 604800 1800
z3lab.info. 1800 IN NS ns1.digitalocean.com.
z3lab.info. 1800 IN NS ns2.digitalocean.com.
z3lab.info. 1800 IN NS ns3.digitalocean.com.
z3lab.info. 1800 IN A 46.101.197.231
*.static.z3lab.info. 1800 IN CNAME z3lab.info.
*.v2.z3lab.info. 1800 IN CNAME z3lab.info.
test.z3lab.info. 1800 IN CNAME z3lab.info.
cms.z3lab.info. 1800 IN CNAME z3lab.info.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
A wildcard means you can replace that with any name and it will resolve to the same record, whether you type example.static.z3lab.info or example1.static.z3lab.info.
Neither of them are “more correct”.
RFCs are the great information for this.
Which subdomains are more correct, and why do we use wildcard?
Both are just as correct as they are both valid types of CNAME records. Both CNAME and A records will generally support a wildcard (*) like what is shown in your records. For example if you have the record:
*.static.z3lab.info. 1800 IN CNAME z3lab.info.
Any request for www.static.z3lab.info or someothername.static.z3lab.info will be directed to z3lab.info
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.