Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I believe this is a simple question, I thank you in advance for clearing it up for me.

Using this example:

foo.domain.com        CNAME  bar.example.com
bar.example.com        A      192.168.1.19

The client requests foo.domain.com in their browser.

Does the name lookup simply resolve to 192.168.1.19 and their request is made to the server at that address with host header foo.domain.com? Or are they actually redirected and their request is made with host header bar.example.com?

Do I need to configure the server to listen on the new host name (foo.domain.com), with a valid SSL cert for it, etc? Or is the existing configuration for bar.example.com sufficient?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

DNS request is resolved first and then the browser connects to 192.168.1.19 with the following header:

Host: foo.domain.com

So yes, you have to configure a virtual host for foo.domain.com. Also, you will need a SSL certificate for foo.domain.com, because I suppose that you current SSL certificate is for bar.example.com.

share|improve this answer

Because hosts are in different zones, don't forget trailing dot after hostname in CNAME

foo.domain.com CNAME bar.example.com.

Does the name lookup simply resolve to 192.168.1.19 and their request is made to the server at that address with host header foo.domain.com?

Yes, exactly

Do I need to configure the server to listen on the new host name (foo.domain.com), with a valid SSL cert for it, etc?

Yes, at least it's true for Apache (newer used IIS). Don't forget - you can't use different certs for different hosts on the same IP and the same port. Your have to use wilcard cert of differentiate https ports per site

share|improve this answer
    
+1 thanks for the help! –  mikey Oct 12 '11 at 14:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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