How to Host a Subdomain on Another Server or Hosting Company…

There are many times when it would be useful to host a sub-domain of your main site on another server or hosting company altogether. Maybe your sub-domain has outgrown the main site and you want to host it elsewhere for a better deal, maybe you’ve got some ultra cheap static file hosting for serving up images and videos elsewhere or maybe you have a company that allows you to have an affiliate store or something like that and they allow you to use your own domain. …except that you want to create a sub-domain of your main site to ensure consistency, customer trust and to retain your branding.

Whatever your need, the solution is simple, but requires you to have access to your DNS records for your domain. These will usually be found at your hosting company. If you use cpanel/whm, then this is fine - if you have access to the actual files themselves then this is good too.

This is completely different to how you’d normally set up a “soft” sub-domain which is essentially a folder within your normal site. Before you start you’ll need to know the IP address of the server that will be hosting the sub-domain account. In the instance that you’re creating another account, say with cpanel on another host, then go ahead and set up that new account. Where it asks you to enter your domain name you should enter the sub-domain and set it up as normal. If you want to point your sub-domain at a site where someone else deals with the hosting, then you’ll have to ask them for the IP address.

DNS Functions Once in possession of this, you then need to edit your DNS record. If you’re using WHM/Cpanel then you’ll see the option called “Edit DNS Zone” in the left hand menu. The select the domain name for the zone you wish to edit.

Don’t be scared of the next screen, just scroll down to where it says “Add New Entries Below this Line” and in the first column type the name of your sub-domain (just the first part, not the fully qualified name. For example if you are creating dominos.mygames.com then enter dominos). Leave the numeric value in the next column, and make sure the drop-down menu is selected as “A”. In the next column you then enter the IP address of the new server that will host the sub-domain. There may be extra blank boxes after this, but these can be ignored. Then click “save”.
DNS New Entry
If you’re editing your own files then you’ll need to locate your zone file, and in the section where the other sub-domains are set up (localhost, mail, www, ftp) add the line to set up your sub-domain. Zone files are often located in /var/named or /var/named/chroot/var/named.

0 التعليقات: