[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Whats the difference between CNAMES and Sub-Domains?

Posted on 2008-11-07
Medium Priority
Last Modified: 2013-12-24
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?
Question by:Jeffreym17
  • 3
  • 2
LVL 58

Expert Comment

ID: 22919659


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.


Author Comment

ID: 22920108
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?



Author Comment

ID: 22921001
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.
LVL 58

Accepted Solution

tigermatt earned 2000 total points
ID: 22922776

I would suggest you try a CNAME to start with.


Author Closing Comment

ID: 31514605

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question