CNAME Website Redirect

Good Morning,
    We have a vendor hosting a website for us on their domain, and I want to add a redirect(alias) to it in our DNS.  Let's assume the vendors domain is vendor.com, and or domain is domain.com.  The website is askdomain.vendor.com, and I wanted to do a redirect from ask.domain.com.  I made a cname record that points ask.domain.com to askdomain.vendor.com, but it's not working.  Am I missing a key point of CNAME redirects?  

Mic

MVLAHelpdeskAsked:
Who is Participating?
 
Chris DentConnect With a Mentor PowerShell DeveloperCommented:

It's not quite what happens, but it's near enough.

The trouble is, you're expecting what happens in DNS to have some kind of impact on the browser, and it won't.

Ultimately you'll get the IP address for the final A record back. However, any HTTP requests will be submitted with the typed address, not the target of a CNAME.

Chris
0
 
MVLAHelpdeskAuthor Commented:
Some more details, it's not working meaning when I visit http://ask.domain.com it comes up with a 404 not found, but when I visit askdomain.vendor.com it comes up.  
0
 
Jan SpringerCommented:
The CNAME record for ask.domain.com should point to askdomain.vendor.com.  Reload DNS to get the changes to take effect.
0
Building an Effective Phishing Protection Program

Join Director of Product Management Todd OBoyle on April 26th as he covers the key elements of a phishing protection program. Whether you’re an old hat at phishing education or considering starting a program -- we'll discuss critical components that should be in any program.

 
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
I suspect the vendor is using a host header so that they can host MANY websites with the same IP address, based on the 'askdomain' portion of the address.  Your best bet might be to work with the hosting vendor to determine if they support what you are attempting to do, and may be able to add your host header ... alternately, you might need a webserver responding at ask.domain.com to perform a redirection.
0
 
Chris DentPowerShell DeveloperCommented:

> Am I missing a key point of CNAME redirects?  

Yes. No such thing.

DNS does not redirect. What you have there is an Alias. The request will still reach the web server using the original name (ask.domain.com). Therefore the web-server must be willing to answer on that name.

If it is not, you must find another web server to redirect the request.

Chris
0
 
MVLAHelpdeskAuthor Commented:
So what's our best option?  A local redirect seems easiest.  Just put a HTML page with the redirect on our webserver, but that's adding another link in the chain.  Is there a DNS based solution?

MIc

0
 
Chris DentPowerShell DeveloperCommented:

No, DNS will not redirect for you. DNS cannot modify the address you type into an address bar in any way.

Either the web server you talk to needs to answer on the name you're using, or you need to have another web server in the chain.

This is a very common misinterpretation of the CNAME record. It aliases one name to another on the DNS level, it doesn't do anything for "stuff" that operates outside of DNS, such as web services or browsers.

Chris
0
 
Jan SpringerCommented:
Yes and no.  Technically, the author needs both the CNAME and the Server Alias within the webserver configuration *or* the webserver needs to rewrite the HTTP_HOST.
0
 
MVLAHelpdeskAuthor Commented:
I'm a little confused.  I thought, user types ask.domain.com into his web browser.  Computer forwards DNS Request to domain.com's Name Servers which respond with the CNAME record, back to the computer.  Computer sends a second DNS request then to the domain name server listed in the CNAME reply, in this case, askdomain.vendor.com, whicih replies with the IP Address for the A record queried.  Can someone detail out the DNS Flow that is correct for a CNAME?
0
 
MVLAHelpdeskAuthor Commented:
So what's my best option then?  I can't believe this is that unique of a situation.  They are hosting our site, however we want it to be accessible from our domain name, and appear to be at our domain.  

0
 
Jan SpringerCommented:
You want them to set up a ServerAlias record in virtual host container (or whatever the equivalent is with what they're running) within their webserver configuration.

This should be a no brainer for them.
0
 
Chris DentPowerShell DeveloperCommented:

Agreed, on the hosting side this kind of request is extremely common. It's not that you're asking for something out of the ordinary, only that you're looking in the wrong place (DNS instead of the web host).

Chris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.