WebsiteGear Logo Log In
New User? Sign Up
About | Contact | FAQ
  Home Content Web Hosting Saturday, July 27, 2024 
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 Casino of the Kings Site Redesign and YouTube Channel Launch
Casino of the Kings, is proud to announce an upcoming redesign of its official website: https://casinoofthekings.ca/ . TORONT...
News Post Remote.It Launches Open Source Project to Enable Easy WiFi Network Setup for Raspberry Pi Devices
Access all devices on the same network, removing complex configurations; Currently available on GitHub PALO ALTO, Calif., Jul...
News Post AutoDrill Launches Innovative Online Product Configurator to Enhance Customer Experience Built by CADENAS PARTsolutions
Industrial manufacturer adds digital tools for engineers to configure and download 3D CAD models for the AutoDrill 2000 serie...
News Post Gluware 5.4 Revolutionizes Network Automation with the Industry's Best Discovery Capability, Seamless Ansible Playbook Integration, and Limitless Customization
SACRAMENTO, Calif., July 23, 2024 /PRNewswire/ -- Gluware , the leader in intelligent network automation, today announced the...
News Post Online Generator Seller Announces Cummins 7-Day Inflation Fighter Discount For Homeowners
Cordova, Tennessee based Buckeye Power Systems, LLC announced its partnership with Cummins Power Generation and a 7-day infla...
Submit News | View More NewsView more news
RELATED CLASSIFIED ADS
Classified Ad ClubVPS – True Cloud In New York/Hong Kong/IL/Am
http://www.clubvps.com/products/cloud" provide reliable, professional, High Availability Cloud ...
Classified Ad Looking for a Sr. Software Engineer in Vadodara
Sanah Infosolutions , Vadodara (www.sanahgroup.com) is looking for Sr. Software Engineer for its Cl ...
Classified Ad Outlook Customer Support Number 1-888-467-5540
Outlook User Facing technical problems in your outlook account such as: Configuration setting pro ...
Classified Ad PRACTICAL SQL DBA ONLINE TRAINING with PROJECT
SQL School is one of the pioneers IT Institutions providing specialized in SQL Server 2012 DBA Train ...
Classified Ad HTML TAGGING PROJECT CONVERSION AVAILABLE
We have developed HTML Tagging Conversion software which can convert any TIFF Frech Srcipt Image to ...
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 ...
Forum Post 8 Steps to Choosing the Right Web Host
Here is an article I wrote a while ago but figured I would share this with other people for their co ...
Forum Post DIY photo collage yearbook with digital photos
Christmas is coming and a year also comes to its end right away. From beginning to end, from spring ...
Add New Post | View More View more forum posts
POPULAR ARTICLES
Nav How To Sell A Website
Nav Subdomain Configuration - How To Setup A Sub Domain
Nav Domain Configuration - How To Setup A Domain Name
Nav Website Layout - Tips & Tricks
Nav Round Robin DNS Load Balancing
Nav Introduction To Server Load Balancing
Nav Website Traffic & Revenue
Nav Tips On Using SubDomain
FEATURED NEWS | POPULAR NEWS
View More News View More News