I have configured the DNS records for a stage server for my application so that when someone visits stage.example.com
and www.stage.example.com
will work. (Actually if he visits the first he will be redirected to the second by the webserver.)
My zone configuration file for this setup is:
@ 10800 IN A 1.2.3.4
stage 10800 IN CNAME example.com.
www.stage 10800 IN CNAME example.com.
and it works.
Now I want to configure my live server with the same behaviour (allow both www.example.com
and example.com
) while maintaining the existing functionality regarding the stage subdomain, but I cannot figure out the correct way to do it - or if it is even possible.
All my searches end up in examples about to configure it for one level subdomains, so I'm a bit lost here.
For example the following configuration is what I think I want, but it's not working
example.com 10800 IN A 5.6.7.8
stage.example.com 10800 IN A 1.2.3.4
www 10800 IN CNAME example.com.
www.stage.example.com 10800 IN CNAME stage.example.com.
Any ideas/suggestions are most welcome.
Thank you in advance.