Domain Registration
When you want to register a new domain name for yourself or your company, you have to choose among thousands of companies who offer this service. All companies that register domain names must be ICAN accredited. I recommand to opt for a large and known company like www.register.com or www.godaddy.com. Www.yahoo.com can register the domain name for you. They often offer a waived price as low as $2.99. I have worked with all of them, and the best customer support and assistance came from Godaddy.
Another important element in the domain registration process is the time of registration. All companies will allow you to register a domain name for as little as one year. There are rumors that in the search engine optimization (SEO) process that it is better for a website if the domain name that points to it has been registered for at least five years. They think it shows that a company is more trustworthy. I do not think that is true, because somebody who has worked to promote his website for one year will not throw it away.
Domain Name Configuration
Before understanding how to configure a domain name, one should know how a domain name works. There are three parts to the process of setting up a domain name for a website:
-
Registering the domain name with a domain registrar;
-
Setting up the domain name entry in a DNS server;
-
Configuring the web server to listen to the requests for the domain name. A request for the domain (e.g. http://websitegear.com) starts at one of the registrar's server, which then routes it to a DNS server containing the DNS information for the domain. Once the DNS record for the domain resolves the domain name to a particular IP address, the request is sent to the web server listing that IP address. The web server can now delegate the request to the particular website based on the domain name in the host header of the request object.
Registering A Domain Name
After deciding on an available domain name, one has to provide the following information during the registration process:
- Domain name owner
- Administrative contact credentials
- Technical contact credentials
- Domain Name System (DNS) server details
The DNS server is usually provided by the web hosting firm. The DNS server should have entries of the domain name as explained in the next section.
Domain Setup On DNS Server
The domain setup on the DNS server can be done after the domain is registered, but the domain name will not work until the DNS setup is completed.
A DNS server maps a domain name to IP address(es) of the web server and mail server, so that a client can connect to the webserver or mail server using the domain name and not the IP address. A forward lookup zone is created for the domain name in the DNS server. Start of Authority (SOA), Name server (NS), Hostname (A), Canonical Names (CNAME) and Mail eXchange (MX) entries are added to the forward lookup zone as shown below for a domain "foodomain.com" with name servers "ns1.server.com" and "ns1.server.com".
Start Of Authority (SOA) Record: The SOA record is very important because it denotes the official DNS record for the domain name. There can be only one SOA record for each domain in a zone file.
@ IN SOA ns1.dnsserver.com. hostmaster.dnsserver.com. (
20041014 ; serial number
900 ; refresh
600 ; retry
86400 ; expire
3600 ) ; default TTL
Address (A) Record Entry: The address (A) record is added to the forward lookup zone of the domain and it is associated with the IP addresses of the web server, which will handle the requests for the domain. There can be multiple A records, in which case, it will use the round robin DNS load balancing mechanism to assign the requests.
foodomain.com IN A 123.2.33.45.
foodomain.com IN A 123.2.33.46.
Alias (CNAME) Entry: A canonical name (CNAME) record maps an alias to the real name. Note that an alias for www is setup as a CNAME, so that requests to www.domain.com are sent to the same website that handles the requests for domain.com.
www IN CNAME foodomain.com.
Name Server (NS) Record: The NS record is used to define the name servers for the domain. It may seem unnecessary to keep a record of the name server in the DNS entry because the name server lookup is already present in the registrar records, where the lookup for the domain starts. This record is needed in case someone requires to know the name servers for this domain. The NS records are mapped to CNAME entries (ns1 and ns2 in the example below).
foodomain.com IN NS ns1.dnsserver.com.
foodomain.com IN NS ns2.dnsserver.com.
Mail Exchanger (MX) Setup: The mail exchanger domain configuration is required if an email server is setup to handle the domain mail accounts. For example, an email address like joe@foodomain.com will require a domain setup for resolving the mail server for foodomain.com. The setup is similar to the CNAME setup but with MX records. There can be multiple MX records (e.g. for backup mail servers).
foodomain.com IN MX 10 mail.foodomain.com.
Note: Test the DNS setup of the domain using DNSReport.com. This site provides a detailed report of any DNS misconfigurations and possible solutions. If isn’t everything green, don’t panic. Ask your web hosting company about it.
Configuring Web Server For Domain
Once the DNS server is setup to send the request for the 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 domain based on either the IP address or the host header entry. Host headers are commonly used by web servers to host multiple domains on one IP address.
Microsoft Windows IIS: In case of Internet Information Server (IIS), create a new web site for the domain using the IIS Manager, and add the domain (e.g. 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. Set the home directory for the domain web site to the directory (e.g. C:\Inetpub\wwwroot\). Add another host header entry for www.foodomain.com so that anyone can access the website when typing www in the beginning.
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 domain.com
DocumentRoot /home/httpd/htdocs/
</VirtualHost>
Conclusion
Domain names are just some names added to an IP address. It is easier to keep in mind a domain name then an IP address. That’s why a domain name must listen to an IP address. That Ip address is the numerical address of the server your website is hosted on.