Anyone running websites on a dedicated server deals with DNS in order to make their websites point to that server.
There are two basic ways this is done:
- DNS hosted by someone else, such as your domain registrar or data center, who creates all of the necessary DNS zone info on their servers. There are also third party companies which do this for a fee.
- DNS hosted locally on your own box.
This second option is preferable to most people as the server administrator will have complete control over the zone info and does not need to wait for an outside provider to submit the info to their servers; the administrator can do it himself and it will be done automatically when a website, pointer domain, or subdomain is created.
However, it does require a bit of setup and understanding of what DNS is and how the DNS system works on the internet. This document aims to make this process as painless as possible.
Basic Explanation of DNS and How It Works:
DNS stands for Domain Name System. Simply put, DNS is a worldwide database identifying domains and the Internet Protocol (IP) address of the server on which they are hosted.
Every computer connected to the internet (even your own home computer) has an IP address. For example, the IP address of the machine hosting interworx.com is 184.108.40.206. There are two types of IP addresses: static and dynamic.
- A web server requires a static IP (an IP that does not change).
- In most cases the IP of your local machine will be dynamic (meaning that it will change every time you connect to the Internet).
To make this whole thing clearer, let’s go through the process your browser goes through when you visit our site.
When you type interworx.com the first thing your browser does is contacts your internet service provider’s local nameservers (called resolvers) and asks for the name of the nameserver that holds authoritative info about the location of that website. In this case it will tell your browser ns1.nexcess.net and ns3.nexcess.net on IP addresses 220.127.116.11 and 18.104.22.168.
Your browser then tries to contact ns1.nexcess.net at the IP address provided and asks for the IP address of the machine hosting interworx.com. If it is unable to contact ns1.nexcess.net then it attempts to contact ns3.nexcess.net. If both contacts are unsuccessful the attempt times out and you get an error message.
Your browser then contacts 22.214.171.124 on port 80 (the standard port for non secure websites) or 443 (the secure website port).
From here the Apache web server will be listening on port 80 for these requests (assuming it is up, that is) and then serve the files located in
/home/interwo1/interworx.com/html/ to your browser.
This is a very simplistic explanation of a very complicated thing, so many details have been left out, but you can find out more info about DNS from numerous books and Internet sources.