Use of CNAME to redirect http access

Marius - Roma 371 Reputation points
2023-10-30T13:06:51.7033333+00:00

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?

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,611 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.