Use of CNAME to redirect http access
I am confused about the use of CNAME record to redirect the access to web sites.
In a lab environment I performed some tests using the DNS service on Windows Server 2019.
The DNS server is configured to use itself as its DNS server.
In the server hosting the DNS service I see that I can access via browser either www.company1.com and www.company2.com (either existing web sites).
In my DNS server I created a forward zone named company1.com add inside the zone I created a www CNAME record pointing to www.company2.com
Writing www.company1.com in my browser I would expect to access the www.company2.com page but this does not occur.
What is the mistake I am making?
- What do I have to do so that if I write www.company1.com I am redirected to the www.company2.com page? Regards