View Full Version : Hosting subdomains at different IPs

12-02-2009, 11:54 AM
Has anyone done this? I have inherited a domain which has its blog on blogspot, but I would like to host a subdomain here. The DNS is hosted by a third party.

Any pointers on how to do this? Do I merely put a CNAME record in the other DNS?

For example

test.example.com. 10800 IN CNAME example.myWesthostAccount.com

and then setup my Apache configuartion to redirect test.example.com to the appropriate directory?

Do I also need to setup example.myWesthostAccount.com so that Westhost know where to redirect things?

Guess I could just read the Blogger help, but thought I'd ask first.

12-03-2009, 06:03 AM
When you say the DNS is hosted by another part do you mean the registration? If so then normally they have an interface that allows you to point domain to the WestHost Namservers. You would do that then add the domain to your account here.

Now if you are wanting to just point the sub domain set up for the blog and not the entire domain here then you should check the third parties documentation and see how they want you do do it. Here at WestHost I used an A record to point a subdomain over to vps.net where I had a static IP while I was testing things over there. It could be you could do the same thing with them if you have a static IP here.

12-03-2009, 08:50 AM
Thanks Shaun.

No. The Nameserver is neither Westhost's, nor blogger's, nor registrar's.
Here's the situation:
Registrar - Company A
Nameserver - Company B
Blog - Company C (Blogger). Subdomain www
Mail - Company D
Subdomain - Company E (Westhost)

Complex huh!

Unfortunately I am time deprived at the moment, so do not have the time to research the answer.

I think that I can use a CNAME to redirect test.example.com to example.MyWesthostAccount.com and that I simply need to configure Apache for test.example.com so that it doesn't appear as example.MyWesthostAccount.com in people's browsers.

What will happen is that your browser will ask for the DNS record for test.example.com. It will look up the Nameserver for example.com (at Company B) and find the record for test.example.com. This in turn points it to example.MyWesthostAccount.com, so it lookus up the nameserver for MyWesthostAccount.com which point to Westhost's nameservers. If I define the subdomain example.MyWesthostAccount.com through my Site Manager, Westhost will use the CNAME record on their nameserver to point to MyWesthostAccount.com and finally return the IP address of my server from its A record.

Now your browser knows the IP Address for test.example.com. It now sends an HTTP request to the Apache server on port 80 at your IP Address.

Apache will be configured for example.MyWesthostAccount.com by the site manager. I guess that I'll have to manually edit it to cope with test.example.com (which is fairly simple to do). The trouble is that I don't have full access to this domain, so if it doesn't work first time, I have to wait for someone even busier than me to make the changes, which would be a pain.

12-04-2009, 06:39 AM
A CNAME would work I believe but if you have a static IP at WestHost I think it would be just as easy to create an A record for test.example.com that points to your static IP at WestHost. The only drawback of this would be if WestHost had to change your assigned IP. You would then need to repeat the process.

From my limited knowledge of all this your thought process seems right. I think it would work unless I am overlooking something.

12-05-2009, 09:13 AM
Something didn't work quite right, but I think it was Firefox.

We simply defined a CNAME record on the original Nameserver

test.example.com. 14400 IN CNAME example.MyWesthostAccount.com.
(Note the '.' after the domain names)

and then defined the subdomain example.MyWesthostAccount.com through the site manager, which added the following to the DNS records for my Nameserver

example.MyWesthostAccount.com. 10800 IN CNAME MyWesthostAccount.com.

You can check if this much is working by typing nslookup test.example.com oon a PC and you should get the following answer

Non-authoritative answer:
Name: MyWesthostAccount.com
Address: 208.xxx.xxx.xxx
Aliases: test.example.com

(or you can type dig test.example.com in Unix - just look for the same information in the ;;ANSWER SECTION)

The final piece in the jigsaw was to edit Apache's configuration (/etc/httpd/conf/httpd.conf)
I simply added the following at the end

<VirtualHost *:80>
ServerName test.example.com
ServerAlias www.test.example.com
DocumentRoot /path/to/example

This is enough to get started.

As you say, I could have used an A record at the original Nameserver, but then I would have to remember to edit that if the IP address for my server ever changed. Much simpler to let the electrons do the work for me ;)

11-28-2011, 08:53 PM
Your question does not make sense. In fact not sure why you are tagging any of your questions on to other threads that do not seem to pertain to your questions. Are you a spammer? :)