STEP 1: Purchase Domain at Domain Registrar
e.g. abdullahyahya.com is registered at godaddy
- GoDaddy
- Hover
- Gandi
- etc
How to find where a domain is registered?
Do a whois lookup, e.g. http://www.whois.com/whois/abdullahyahya.com
STEP 2: Set Domain Name’s Name Servers at Domain Registrar’s Control Panel
e.g. below is the control panel to set the name servers for abdullahyahya.com
How to find a domain’s name servers?
Do a whois lookup, e.g. http://www.whois.com/whois/qualys.com
In the example above, the name servers for abdullahyahya.com point to
- ns1.gnu.arvixe.com
- ns2.gnu.arvixe.com
STEP 3: Set Domain Name’s Zone Records in Name Servers
The name servers above belong to the web hosting company Arvixe.com. The domain name’s name servers contain zone records to manage the mapping between domain name and corresponding server ip address. The zone records can be updated be editing a text file or via a control panel.
You can created various types of records, e.g.
- A – points a domain name to a web server’s ipv4 ip address
In the example above, example.com points to 192.0.2.1 - AAAA – points a domain name to a web server’s ipv6 ip address
In the example above, example.com points to 2001:db8:10::1 - CNAME – creates an alias for a domain name
In the example above, www.example.com points to example.com (which points to 192.0.2.1). Use CNAMEs so that the domain will always point to whatever ip address its aliased domain name points to. - MX – specifies a mail server for a domain
In the example above, example.com’s mail server is mail.server.com (which points to 192.0.2.3 according to the A record for mail.server.com)
Note that you can specify records for subdomains like abc.example.com or xyz.abc.example.com.
In the example for abdullahyahya.com, the zone records can be manage via a control panel at Arvixe.com.
How to find the zone records for a domain?
Run the dig command as follows.
or you can use a web based tool at http://www.digwebinterface.com/
STEP 4: Specify Domain Name’s Document Root on Web Server
When people go to abdullahyahya.com, a DNS lookup with find that that domain points to the server at 162.254.167.117 which is a web server running Apache. In the Apache configs, you can create virtual host configurations to map between a domain name and a document root, e.g.
In the example above, www.example.com points to the folder /www/example1 and www.example.org points to /www.example2
See various other types of virtual host configurations