Whats the difference between CNAMES and Sub-Domains?

were these subdomains set up as CNAMEs through your Control
Panel or as simple subdomains? This is my web host where am hosting my website and trying to create a subdomain that will forward to some other destination URL but while this happens the browser should show my subdomain as the destination URL and not the one which it has been forwarded to.

Please let me know how to achieve this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.



A CNAME and Subdomain are two very different concepts. A CNAME is a concept in the Domain Name System (DNS), which essentially enables you to create an alias from one domain to another. For example, I could create a CNAME record called subdomain.site.com, and set it as an alias for site.com. Whenever anyone visits subdomain.site.com, they will instantly be taken to the main site, since DNS will resolve the IP address of the main site rather than the subdomain. Using CNAME records is good in some cases, primarily because it takes load off the web server - it is not the web server which does the redirection, in fact no traffic must pass through the web server until you reach site.com, so it is good performance-wise.

A subdomain is a completely separate website in its own right. In the DNS system, creating a subdomain would create an A record in DNS mapping that subdomain to a physical web server IP. Whether the IP of the server hosting the subdomain and the IP of the server hosting the main site is the same, or different, it does not matter, since they are completely separate entities in their own right.

In this case, since you want to redirect between two pages, I would probably go with the subdomain route, rather than the A record approach. This is primarily because at a web host, your main site (which you redirect to) will only listen on one particular domain name - the main site's domain - and trying to resolve it through a CNAME would probably fail.

Once you create your subdomain, you'd want to use either the host's in-built functions to specify a redirection target, or upload a small piece of code to redirect for you. There is plenty redirection code which can be found online.

Jeffreym17Author Commented:
Hello tigermatt,

Thanks for the effort you took to put down the details answering my question. And although I have understood a lot because of you, But as am confused because of my host responses. Please if possible can you put down the exact steps to be followed to achieve the following:

1) When the USER types http://subdomain.mydomain.com/
2) The page that displays to the USER is from http://subdomain.otherdomain.com/
3) But in the end of the process the address bar should show up as http://subdomain.mydomain.com/ to the USER

I mean should I used CNAME or Subdomain to reach out to my expectations?


Jeffreym17Author Commented:
Hi there again,

Look I have successfully reached the second step mentioned in my above POST.

But will be glad if you can give me all the possible ways to reach out to the third step.

I would suggest you try a CNAME to start with.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffreym17Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.