WebsiteGear Logo Log In
New User? Sign Up
About | Contact | FAQ
  Home Content Web Hosting Saturday, May 10, 2008 
POPULAR ARTICLES
Nav Subdomain Configuration - How To Setup A Sub Domain
Nav Website Layout - Tips & Tricks
Nav Round Robin DNS Load Balancing
Nav Domain Configuration - How To Setup A Domain Name
Nav Introduction To Server Load Balancing
Nav Server Load Balancing Methods
Nav Tips On Using SubDomain
Nav Breadcrumb Navigation
FEATURED NEWS | POPULAR NEWS
View More News View More News
SPONSORED LINKS
Print| Email| Save| Discuss| Feeds


Subdomain Configuration
Published: Monday, August 16, 2004


Subdomain Configuration
A subdomain configuration is very similar to a domain name configuration. The only difference is that the subdomain entry is tied to the corresponding domain name lookup. A request for the subdomain (e.g. http://content.websitegear.com) will be routed to a DNS server containing the DNS information for the parent domain (websitegear.com). Once the DNS record for the subdomain is resolved to a particular IP address, the request is sent to the web server listening on that IP address. The web server can now delegate the request to the particular website based on the subdomain name in the host header of the request object. Various combinations of subdomain configurations are possible by using DNS server entries and web server application setup for load distribution, application isolation or security purposes.

Subdomain Setup on DNS server
The forward lookup zone of the parent domain in the DNS server should contain a pointer to the sub domain using either an alias (CNAME), a hostname (A) or a mail enchanger (MX) entry. The alias (CNAME) record is used for a subdomain if the subdomain points to a website running on the same web server at the same IP address as the parent domain website. A new hostname (A) record is used if the subdomain points to a different web server, or to the same web server listening on a different IP address (as in the case of load distribution).

Alias (CNAME) Setup: An alias points the subdomain to the same web server, which hosts the website for the parent domain. The canonical names (CNAMES) are added for each of the subdomains as shown below. Once the subdomain is resolved to the IP address of the web server, the web server can route the request to a different website (see section on web server setup below). Note that an alias for www is setup as a subdomain by default by most hosting companies, so that requests to www.domain.com is sent to the same website that handles the requests for domain.com.

www IN CNAME domain.com.
subdomain1 IN CNAME domain.com.
subdomain2 IN CNAME domain.com.


Address (A) Record Setup: A hostname DNS entry is required if the subdomain is pointing to a different IP address than that set for the domain name. Add the address (A) records to the forward lookup zone of the parent domain and associate the address records with the IP addresses of the web servers, which will handle the requests for the subdomain.

subdomain1 IN A 123.2.33.45.
subdomain2 IN A 123.2.33.46.


Mail Exchanger (MX) Setup: The mail exchanger subdomain configuration is required if an email server is setup to handle the subdomain mail accounts. For example, an email address like joe@arts.myschool.edu will require a subdomain setup for resolving the mail server for arts.myschool.edu. The setup is similar to the CNAME setup but with MX records.

subdomain1 IN MX 10 subdomain1.domain.com.
subdomain2 IN MX 10 subdomain2.domain.com.


Note: If the sub-domain is configured on another DNS name server, a Name Server (NS) record has to be created for the sub-domain on the corresponding domain name DNS server, so that it can delegate the sub-domain lookup to the other name servers. Using different name servers can eliminate security issues in cases where the sub-domains are maintained by separate administrators. However, the lookup carries an additional overhead.

Configuring the web server for sub-domains
Once the DNS server is setup to send the request for the sub-domain to the corresponding IP address, the work of the web server begins. The web server needs to be configured appropriately to handle the request for the sub-domain based on either the IP address or the host header entry. Host headers are commonly used by web servers to host multiple domains or sub-domains on one IP address.

Microsoft Windows IIS : In case of Internet Information Server (IIS), create a new web site for the subdomain using the IIS Manager, and add the sub-domain (e.g. subdomain.domain.com) as a new host header value listening to the same IP address as specified in the DNS entry. The port is set to 80 (the default for http requests). The host header can be added by clicking on the advanced tab next to the IP address configuration for that web site application. If the subdomain points to a subdirectory of the web site for the domain, then set the home directory for the subdomain web site to the subdirectory. For example, if the domain.com points to C:\Inetpub\wwwroot\ and the subdomain needs to be setup for C:\Inetpub\wwwroot\subdomain, then the directory for the subdomain website should be set to C:\Inetpub\wwwroot\subdomain.

Apache Web Server : In case of Apache web server, the subdomain is configured by virtual host entries in httpd.conf as shown below.

Listen 80
NameVirtualHost *

<VirtualHost *>
ServerName www.domain.com
DocumentRoot /home/httpd/htdocs/
</VirtualHost>

<VirtualHost *>
ServerName subdomain.domain.com
DocumentRoot /home/httpd/htdocs/subdomain/
</VirtualHost>


Conclusion
Sub-domain configuration starts with an entry in the DNS server of the parent domain and the lookup resolves the sub-domain to an IP address of the web server. The web server in turn delegates the requests based on its configuration for the sub-domain. Various sub-domain configurations can be used effectively to distribute the load evenly among available web applications or web servers listening to different IP addresses. The load distribution is achieved by the DNS round robin feature of the BIND. Other uses include application isolation, simpler and professional looking URL, content categorization etc.
Previous Article Tips On Using SubDomain
Print| Email| Save| Discuss| Feeds
RELATED ARTICLES
Nav SubDomain - The Third Level Domain
A subdomain is the part of the website address before the domain name. Learn about using subdomain names.
Nav Introduction To Server Load Balancing
Load balancing applies to all types of servers (application server, database server), however, we will be devoting this section for load balancing of web servers (HTTP server) .
RELATED NEWS
News Post Biztology launches version 2.4 of Cube Panel
Version 2.4 of the server automation software is now available for Windows and Linux operating systems and features a new str...
News Post FreeWave Technologies to Lead Hands on Class on Wireless Technologies at ISHM 2008
Brent McAdams to show the advantages of using wireless technologies
News Post Statera Brings Recruiting Depth and Consulting Experience to Newest Operation in Dallas
Local Business and IT Consultancy Adds Proven Talent To Dallas Team
News Post Software aids network change and configuration management.
With model-based approach to configuration management, VoyenceControl v4.0 helps enterprises and managed service providers en...
News Post AT&T Online Seminar to Offer Tips on Achieving Success at Work and On the Go
Bill Collier, Author of How to Succeed as a Small Business Owner and Still Have a Life, Provides Tools to Increase Productivity and Reduce Stress
Submit News | View More NewsView more news
RELATED CLASSIFIED ADS
Classified Ad High Quality Low Price Resellers
Basic Hosting Package (36$/yr): 1 Domain Name, 250 MB web space, 5 GB monthly traffic, 1 ...
Classified Ad Systems Administrator with TS/SCI Fullscope Poly
Work closely with the IT team members on installation, configuration and upgrades to the database ma ...
Classified Ad .mobi .travel .cn .hk .cc .us .sh - Todaynic.com
Todaynic.com,Inc. is the best domain name registrar in China. We are one of both ICANN and CNNIC-Acc ...
Classified Ad Dell Desktop computers hot offer
System configuration : Dell Dimension C521 Desktop Computer 1GB Dual Channel DDR2 SDRAM AMD Athlo ...
Classified Ad Build a Heavy Gaming PC at Arbico Computers
Standard Configuration: - Intel Core 2 Duo 6600 CPU (upgradeable to Intel Core 2 Duo 6700 CPU) - Q ...
Post Free Ad | View More View more classifieds
RELATED FORUM POSTS
Forum Post Strange problem with domain name configuration
We have a few domain names registered with Network solutions. Recently, we changed web hosts. In t ...
Forum Post Configuring BIND on windows 2003 server VPS
Hi Guys, I have a Windows 2003 Virtual Private Server and I'm trying to configure it with a BIND ...
Forum Post Parent servers say that the domain does not exist
I have a certain question related to DNS configuration: 1) a week ago my internet domain SKARBIEC ...
Add New Post | View More View more forum posts


Copyright © 2003-2008 WebsiteGear Inc. All rights reserved.
About | Advertise | Submit Content | Privacy | Agreement | Contact