Having recently ventured into the world of VPS I was soon forced to discover Berkley Internet Name Domain or BIND for short and what It does for web servers. Upon receiving my setup instructions from hostgator I quickly installed the standard LAMP setup on the CentOS box and was content thinking that in 24 hours my domain www.robertmcghee.co.uk would point at my web server, I was wrong.

I’d setup my two name servers as instructed by hostgator pointing at the correct IP addresses, I had Apache installed ready to display the congratulatory successful install page but nothing happened when I pointed my browser at robertmcghee.co.uk. After a quick web chat with the very helpful hostgator support team I was told that I didn’t have a DNS Zone assigned to robertmcghee.co.uk and so nothing would display. Upon hearing this I headed over to Google to find out how to create this magical DNS Zone on the setup that I currently had (here’s a nice LAMP setup guide for CentOS at howtoforge.com).
Install BIND
First up we needed to install the BIND service on to the server. So log into the server with SSH and install BIND this is very trivial matter using yum you just issue the following command:
yum install bind bind-chroot bind-libs bind-utils caching-nameserver -y

Configure BIND
Login to your Webmin account:
Webmin Login
From the menu on the left hand side select Servers -> BIND DNS Server:
Webmin Menu
We need to add a master DNS Zone:
Master DNS Zone
Insert the required details for a master DNS Zone an hit create:
Once the master DNS Zone has been created we need to select it to amend the properties.
From the menu select Address we need to tell the BIND server what domain is hosted at the servers IP Address:
Now that we have our domain linked to the server we need to point our Name Servers at our domain.
Leaving the Zone Name blank takes the address that we setup in the Address option this is true for all the following items:
With the Name Servers setup we can point subdomains to any Fully Qualified Domains i.e. www.example.com. rather than www.example.com/forum/ remembering to add . to the end.
Below are examples of setting up www to point to our domain name and mail to point to a Google Apps domain using what is called a CNAME redirection.
Finally we can add Mail Server records to redirect any email to @robertmcghee.co.uk to another server.
In the example below we’re pointing at a Google domain for use with Google Apps using what is called a MX redirection.
Below is the complete list of the Google Apps MX details including priorities:
With the settings above configured in the BIND server www.robertmcghee.co.uk now points to the correct page and emails to @robertmcghee.co.uk appear in the Google Apps Mail Account.