Subdomain hosting - What are dns subdomains?

A subdomain is anything that appears before your master domain in the URL, and is based on dns. It is technically a third level domain name, and requires a change to your zone file.

Subdomain hosting does not require a separate ip address, although it can, and does not need the www in front of the dns subdomain. It takes the form of As a rule; your zone file lives wherever your website is hosted, which is your dns authority.

It is important to note, you could have a custom dns setup - for example:

You host with the John Doe hosting company. However, your dns is handled by someone else, maybe your isp, lets say. This can be extremely confusing, so be prepared. To get started; contact your web host and they should be able to point you in the right direction, and can tell you what steps you need to take, and can tell you who your dns authority is.

Why would you use subdomain hosting?

Depending on how your webhost is setup there are several different ways subdomain hosting setup is handled. These are only a couple, and apply to Unix web hosting with an Apache webserver:

Wildcard dns can be used, a subdomain setup with no further action - except for the creation of a folder and an htaccess text file on the webmasters part. Multiple subdomains (or machine names) - can be set up this way with no assistance from system admins, all you need to do is create a folder, and an htaccess file with a rewrite rule. The dns will then resolve the subdomain. A subdomain can be pointed off the host server as well, to another ip address entirely.

This is written in your zone file like so:

* IN A

Or; you can create a subdomain; it's written in the dns zonefile; and you can use either .htaccess or httpd.conf to redirect to the folder that you have created for the subdomain. (Windows uses host headers, and usually must be configured by a system admin.) This is written in your zone file like so:

dick IN A
jane IN A
(if you want the subdomain pointing to another server.)

The .htaccess file you would create for either of the above cases will look like this:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
Rewrite Rule for
RewriteCond %{HTTP_HOST}$
RewriteCond %{REQUEST_URI} !jane/
RewriteRule ^(.*)$ jane/$1

This tells anyone that is going to to go to the folder jane on This file is named .htaccess (it is a "hidden" file) and is then uploaded to your root directory.

You can reach the subdomain either by or

There is a third way; if you host with us; is simply to setup the domain in your control panel, where the process is automated. All you need to do is create the folder, no need for an .htaccess file. You can find instructions on Adding a subdomain here.