The sub-domains are attached to the main domain name and this is the reason that sub-domain management is similar to configuration of a domain name. DNS server which has DNS information about the main domain is to be requested for the sub-domain and the sub-domain is to be routed to the same DNS server.
Once the DNS server has the request it resolves the sub-domain and provides the IP address and then the request is sent to the web server which has the IP address. The request can then be moved to the website. Sub-domain configuration can be taken care of by many DNS server entries, and application setup for management of load or applications.
DNS server should point towards the sub domain as CNAME or hostname or MX entry for emails. CNAME or alias is used if the IP address of the main domain and the sub-domain is the same. In case of the load balancing servers, A records are used if the IP points to the different dedicated server.
When the IP address of the sub-domain and the main domain are the same CNAME is used. It means that the main domain and the sub-domain point towards the same IP address :
www IN CNAME domain.com.
subdomain1 IN CNAME domain.com.
subdomain2 IN CNAME domain.com.
A record is setup when the main domain is different from the sub-domain. This is in case of a load balancing or server cluster setup such as :
subdomain1 IN A 123.2.33.45.
subdomain2 IN A 123.2.33.46.
MX records are mail exchanger sub-domains in case of email setup that will be pointing to the dedicated web server IP address and used for different email account such as :
subdomain1 IN MX 10 subdomain1.domain.com.
subdomain2 IN MX 10 subdomain2.domain.com.
Nameserver records is created for the sub-domain if the sub-domain is configured on a different DNS name server. Different nameservers can reduce security issues. The IP address receives request from the DNS server and it starts functioning. It then needs to be configured to manage the request based on the IP address / Host headers. It is utilized by web servers to host different domains / sub-domain on one IP address.
IIS manager is used to add the sub-domains that will be assigned to the IP address in the case of a Windows dedicated server. Port is then set to 80. By clicking on advanced tab nect to IP address configuration for website application host header can be added easily. Sub-domain that points to sub-directory of website which is then home directory for the sub-domain.
In a Dedicated server Hosting , we use Apache web server which is configured by virtual host entry in httpf.conf :
Listen 80
NameVirtualHost *
ServerName www.domain.com
DocumentRoot /home/httpd/htdocs/
ServerName subdomain.domain.com
DocumentRoot /home/httpd/htdocs/subdomain/























Tweet This
Leave a Reply