11

A newbie question regarding dns records

Let's say I've configured, abc.example.com -> A 10.x.x.x

and a CNAME for xyz.example.com CNAME for xyz.example.com -> abc.example.com

when a user does an http request for xyz.example.com what happens when the request reach the 10.x.x.x server. Will the URL be abc.example.com or xyz.example.com? (trying to find out if virtual host in apache need to be updated)

Thanks much

migrated from stackoverflow.com Jun 3 '10 at 15:05

This question came from our site for professional and enthusiast programmers.

15

It will be xyz.example.com - the Host: header will contain the origially requested domain, not the canonical one from DNS

  • 3
    And the Host header is the only thing that tells the server which hostname was used to reach it. – Matti Virkkunen Jun 3 '10 at 14:18
2

The virtual host (as sent in the host header) will be exactly what the user typed into the address field, unless you do some kind of redirect on the server.

  • Would ServerAlias do redirection as well? There is a v host entry for abc...our sysadmin has added ServerAlias as xyz.example.com and says that will do the redirection as well. – Traveller Jun 3 '10 at 14:54
0

I agree with answer from Paul Dixon and calmh.

As far as my understanding goes, in normal conditions the header will be xyz.example.com, only an explicit redirect, not in the DNS server but an Reverse Proxy or on the Webserver can eventually change the HTTP header of the request.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.