pointing one sub domain to another sub domain

I'd like to point one subdomain (i.e. sub.domain1.com) at another subdomain (i.e. sub.domain2.com).

Could someone help me figure out the best way to do this?
Who is Participating?

Improve company productivity with a Business Account.Sign Up

DanJournoConnect With a Mentor Commented:
Ok, in that case you will have to do the following:-

Step 1
Since you only have one system and i guess one IP address for all the domains.....tell the other companies to point their subdomains to your primary domain using a CNAME, or to the IP address of your primary domain. I described this step above.

Step 2
Your hosting system will have host header settings. If you look your subdomain settings, you should find sub.YOURDOMAIN.com. You will need to add sub.OTHERCOMPANY.com to the host header for each sub domain. I can talk you through it with IIS/Windows but i cant tell you how to do it in Linux.


Just did a quick google search and found something interesting. Its not calling Host Header in linux. In apache, its called Name-based Virtual Host.  Some linux web servers dont support Host Headers.

Here is the documentation for Apache which might get your starts:-


It depends what you want to accomplish.

If you want the website from sub.domain2.com to display when you visit sub.domain1.com then I would use a http redirect. This means you need to host the domain in a hosting package.

The other option is to set up sub.domain1.com as a CNAME and set it to poin to sub.domain2.com.

What type of server or hosting are you using?

marglarAuthor Commented:
I'm on a linux based host but I can't say for sure what the pointed domains (domain2) will be on.

I have an application that other companies want to use.  I need to host it but they want it to appear to be on their domain.  

I'll setup a copy of the application in a subdomain on my system and then have them (somehow) create a subdomain that points to my subdomain.

Can you show me what a cname record that would do this, would look like?

Thanks for the help!
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

In that case, i recommend that you tell them the IP address for your system. That will be the same IP address as sub.YOURDOMAIN.com.

If "sub.YOURDOMAIN.com" points to
you should tell them to point their subdomain to

That example would be using a normal A record which means, if you need to move your server or change your IP address, you'll need to tell the other company to change the IP address.
If you used a CNAME, then if you change your IP address, any DNS changes you make to sub.YOURDOMAIN.com would automatically copy over to sub.OTHERCOMPANY.com

"A CNAME record maps an alias or nickname to the real or Canonical name which may lie outside the current zone. Canonical means expected or real name."


marglarAuthor Commented:
My subdomains will not have a separate ip address from my primary domain.  They are actually just sub-directories under the primary domain.

Thats fine.

So tell them either:-

1) to point their subdomain to the IP address of your primary domain
2) to create a CNAME pointed to your primary domain

marglarAuthor Commented:
Hi Dan.

I'm not sure I understand...   I need for them to point their subdomain to one of my subdomains..   Each client will have a subdomain in my domain and they'll want it to appear to be under their own domain/subdomain...

Is your application a web application?

i.e. a website?
marglarAuthor Commented:
yes.   A copy of it will go in each subdirectory to be customized on a per-client basis.
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.