Tuesday, November 10, 2009

How to point Subdomain to another sever host?

I've just recently done the same thing for one of my site. It's actually quite simple, but I don't know how I spent so much time in looking for guides on the net. It's frustrating.

Alright, here's my situation. I have a site mydomain.com and just recently I've created a sub.mydomain.com and wanted to point the subdomain to another sever host. Why? Because it's a huge traffic site and I don't want to add anymore strain to the main server, therefore I bought a new cheaper host for the subdomain.

Are you looking for imformation to do the same thing? You are lucky to find my blog as I'm going to tell you based on my experince and guide you through step by step. Peoples might have thought you are using 2 server, you must know hosting very well. No! I'm just a webmaster and my programmer do all the shit for me except the hosting thing of course. There's a lot of information on the internet actually, if you are willing to spend some time researching, you'll find a way to fix it. The problem is most information they provide are very brief, maybe they thought it was easy and you should be able to understand. I admit I'm not the brightest one, but I can at least understand and follow instructions. When I saw peoples posting something like NS, A record or Cname, I started to get headache. How the hell am I suppose to understand all of them without more explanation, I'm searching for guidance because I'm new to this so please expect everyone to be hosting junky.

Skip above part if you just want to know how to do it:
Please excuse for my whinning, I just have to let it out as it's taking me freaking long time to figure it out. Before you follow my instruction, there's one information you should know. After you edit anything on your server or domain register, it does not reflect on your site immediately. Most of the time you should see changes within minutes to an hour based on my experience. Patience is the key to success, so wait before you start scratching your head. It could be the delayed on your hoster side too, I'm not sure. Anyway, I made some changes yesterday and it doesn't work after waiting for like half an hour, so I just go to bed and guess what happens? Yes, everything is now working as how it should be!

I'm not going to assume you already done the domain part, so here's what you should modify in your domain registrar side. I'm using Namecheap:
1.) Go to manage domain
2.) Select the domain you want to modify
3.) If you already pointed the domain to a nameserver(NS), click transfer dns back to us. After you done that, you should now have the option to modify "All host record". Now click on All host record under the sub-domain settings, enter your subdomain name in the first field, your subdomain hoster namesever on the second field (example: ns22.domaincontrol.com) then chose A (address) from the drop down list. Continue the same with the next line, ususally you have two namesever with the hosting company.
4.) Click save.
5.) Trasnsfer back your main domain dns to your main host by clicking transfer DNS back to webhost. (your main server)

The second part is adding A record on your main domain server. Remember it's not the subdomain server, you don't want to do any editing on your subdomain server. It's going to be a little different depends which company and control panel you use. I've experience in both WHM Cpanel and Godaddy. I hate Godaddy, but their control panel is quite good. Anyways I'll teach you how to do it in both.

If you are using Godaddy hosting:
1.) Login to your account, open your hosing list. Click on manage account and it'll open another windows.
2.) There's bunch of options on top of the menu. If I remember correctly, hover settings or something else, find and select DNS manager. It should open a new window again.
3.) Now you should see your main server DNS information. At the very top, you should see the A record settings and this is where you should add your A record pointing it to sub.mydomain.com IP.
4.) Fill in the A record information. Enter your subdomain name and the IP of the second server, then save it.
5) You are done. Wait until it takes effect.

If you are using WHM Cpanel:
1.) Find the option Edit DNS Zone and click on it
2.) Select your domain and click edit. (I found out that it's not working in firefox, use IE if the same thing happen to you)
3.) Scroll down to the bottom and add a new entry. Eample: sub.mydomain.com. 14400 IN xx.xx.xx.xx A
4.) Click save and you are done. Just wait until it take effect on your site.


Here's some of the main point you should remember. You only edit information on 1) Your domain registrar & 2) Your main domain server hosting. You are not doing any editing on the new host you bought for your subdomain. Basically, all you need to do is add an A record on the main domain server and point the subdomain to second server IP. Tha's it, you are done. Simple!





No comments:

Post a Comment