Error 404 on CNAME forward

cname-recorddomain-name-systemgodaddy

In my DNS manager, GoDaddy I made some A Record that points to *.mirror for my domain

enter image description here

Now when I access URL 123.mirror.mydomain.com from the browser I can see that my app is loaded, and its all OK.

My problem now is when doing a CNAME point to the URL above on another domain DNS manager like this:

enter image description here

Accessing 123.otherdomain.com which I expect to "forward to" 123.mirror.mydomain.com I only get this 404 error:

enter image description here

What I am missing here?

Best Answer

When you try to access a domain with a CNAME record in your browser, two things of significance to this question happen.

1: The browser determines the IP address to connect to. This means that the browser will follow the CNAME record of 123.otherhost.com to the IP of 123.mirror.yourdomain.com

2: The browser will request the page with a host header that is equal to the domain entered in the address bar. This means the browser will request the page from http://123.otherdomain.com

It sounds like you may want to alias 123.otherdomain.com and 123.mirror.yourdomain.com in the same virtual host.

Related Topic