How to set up a sub subdomain

I’ve been getting quite a few hits from Google to the DNS Guide post from people searching for how to set up a sub subdomain.

It’s quite simple actually. Say you want to set up a sub sub domain sub2.sub1.domain.com. All you need to do is create an A record for sub2.sub1.domain.com and point it to the required IP(the IP of the server hosting the sub sub domain). If you want www.sub2.sub1.domain.com to work(not required in most cases), you should create another A record for www.sub2.sub1.domain.com and point it to the same IP. This can also be done using a CNAME record.

So, if the server that is going to host your sub sub domain has IP 1.2.3.4, your DNS records should be like this :

sub2.sub1.domain.com.       A     1.2.3.4
www.sub2.sub1.domain.com.   A     1.2.3.4

If you want to use CNAME records :

sub2.sub1.domain.com.       A       1.2.3.4
www.sub2.sub1.domain.com.   CNAME   sub2.sub1.domain.com.

There may be a lot of reasons why someone would want to use a sub sub domain; the most important of them being forming meaningful(or desired) words/phrases out of a domain name. One of the most popular example of a site on a sub sub domain is www.Del.icio.us. It clearly illustrates the usefulness of a sub sub domain.

8 Comments

  1. Rob says:

    Except for the fact, that del.icio.us is not a sub subdomain but a single subdomain (icio.us is the domain)

  2. Franka says:

    What if you are asked to set up vanilla.test.domain.com, but test.domain.com has no DNS yet, itself.
    Should I first make sure test.domain.com exist with whatever IP-address?

    1. Ellimist says:

      No need for that. Just add A or NS records for vanilla.test.domain.com. test.domain.com does not necessarily need to exist.

      1. Franka says:

        Not even when a wildcard entry exists *.domain.com that would direct test.domain.com to the root?

        1. Ellimist says:

          The wildcard is matched only for (sub) sub domains which do not have a DNS record.

  3. ubur-ubur says:

    how about create it automatically using htaccess?

    Any idea?

    ubur-ubur