Wednesday, September 12, 2007

Subdomain Configuration in DNS

I am posting this as a quick tip for those who want to add a subdomain of some form in a DNS server having domains configured in it.This is usually handy for those system administrators who have to frequently add subdomains as part of hosting services.This is being narrated as a real experience of mine as recently i had to work over it.

The requirement was to add a subdomain (h***dmin.a**s.net) in the form ..net to the DNS gateway at the organisation.The domain has already been existing.I had prior knowledge of adding a domain in the "named.conf" file which is the main configuration file for the server.

The entry is given as following steps:

Step 1: In /etc/named.conf, find the domain file corresponding to the domain which we wish to configure the subdomain. Example for here, the domain in arys.net and the file is :
"/var/named/slaves/sec.arys.net" as evident from its entry in 'named.conf'


Step 2: Open the domain file and give the subdomain as a C or A entry.

This can be either as :

h***admin CNAME www (C Entry)

or

h***admin A