How To Pointing Domain To Server

This tutorial will show you how to pointing The Domain Name you have purchased to your Virtual or Dedicated hosting server. We’ll be using Bind9 which is a free DNS management software available for most Operating System including Unix-based OS.

Step One — Installing BIND9

To install BIND9, type this command on your SSH console

sudo apt-get install bind9 dnsutils

After successfully installing BIND9 and DNSutils, start BIND9 service by inserting this command:

sudo service bind9 start

You’ll see this message

* Starting domain name service... bind9      [OK]

Step Two — BIND9 Configuration

So you have installed BIND9 on your server. It is time to show you a basic configuration how to setup your domain to resolve to your server. Here’s what I did. Type following command then hit Enter on your keyboard:

sudo nano /etc/bind/named.conf.local

Nano editor screen will appear. Type the codes below to the named.conf.local

zone ""{
zone ""{

Again, in any command in this page you’ll need to replace “” with your own domain name and corresponding TLD.

Also, you have to replace 0.168.192 with Reverse IP address of your server. If your IP address is then it will be, without the first part.

After editing the file, hit CTRL+X to close and Y to save.

Now, we will need to create two files which we already defined in the /etc/bind/named.conf.local/ which are


First, the zones/master directory may not exists in your server, so you’ll need to create the directory first with this command:

sudo mkdir /etc/bind/zones/master

Once you created the directory, create a new file with nano editor.

sudo nano /etc/bind/zones/master/

In this file insert the codes below:

; BIND data file for
$TTL    14400
@       IN      SOA (
201006601 ; Serial
7200 ; Refresh after 3 hours
120 ; Retry in 120seconds
2419200 ; Expire after 1 week
604800) ; Default TTL
;  IN      NS  IN      NS  IN      MX      10  IN      A
ns1             IN      A
ns2             IN      A
mail            IN      A
www             IN      CNAME
ftp             IN      CNAME
mail            IN      TXT       "v=spf1 a -all"  IN      TXT     "v=spf1 ip192.168.0.10 a mx ~all"

If you have two IPs, you can replace “ns2 IN A” with your second IP address. Otherwise simply use the same IP. After changing the file, Hit CTRL+X and Y to save.

Note: The, It’s the value of your hostname which is FQDN ( Fully Qualified Domain Name ) you owned. So if your hostname isn’t FQDN you owned please change it.

Hostname, can be change in where you can setup your server OS, etc. for example in it will be located in droplets > droplet name > settings > rename. If you’re using VPSdime which I’m using right now you can easily change it in the service menu for your package. Hostname can use sub-domain or Top Level Domain you owned.

The next file is used to define reverse DNS lookup. So let’s dig in to it:

sudo nano /etc/bind/zones/

The content will be:

@ IN SOA (
86400 );

Step Three — Update resolv.conf

This will be the last thing you need to edit, now open the file with nano editor

sudo nano /etc/resolvconf/resolv.conf.d/base

Add these codes below:


Save the file with CTRL+X then Y.

Updating resolv.conf file with

sudo resolvconf -u

This will updating the /etc/resolv.conf file, which you can see with

sudo cat /etc/resolv.conf

The file will be containing the codes you just insert into resolv.conf.d/base, now restart bind service with:

sudo /etc/init.d/bind9 restart


sudo service bind9 restart

Step Four — Update Domain NS

Personal DNS Server / Child Nameserver / Custom Nameserver / Glue Record

Setting up nameserver can be confusing at first. The problem is this feature can be vary to each domain registrar. Some use the term Child nameserver, other use the term personal DNS / Name server.

Like in, they used the term Personal DNS Server, for the user to add it’s own unique nameserver. Or in, they use the term Custom Nameserver. And in the domain registrar that I used to bought, they call it Child Nameserver. At they call it Glue Record.

If you haven’t setting up this Custom Nameserver, it’s likely that your domain won’t pointing to your server no matter how good the setup is.

You need to create Custom Nameserver. For example, and ( you need at least two ). Then assign your host IP address into them. If you have two different IP address ( recommended ), set it to each nameserver.

After the custom nameserver are registered, you still need to update your Nameserver assigned to your domain, this one is almost the same in many domain registrar, by assigning your custom and to your domain Nameserver.

Below is example on and the other domain registrar that I used:

register-custom-ns-namecheap register-custom-ns-domainesia

That’s it Folks!! Now you wait until the hostname have been resolve to your domain name. then you can acess your domain via browser. Sometime this thing need to wait up to 24 hours mostly faster. You can check your domain status via

Note: If you have issue about Reverse DNS / PTR in This is actually caused by your ISP or Server provider. Some server need you to submit a support ticket for updating your RDNS ( VPSdime ) and some server will automatically update your RDNS based on your hostname value ( digitalocean ).

Second Note: If you want to add second domain, just add the new file and update the zones in named.conf.local, the NS will be pointing to your first domain ns. Eq:

$TTL    14400
@       IN      SOA (
201006601 ; Serial
7200 ; Refresh after 3 hours
120 ; Retry
2419200 ; Expire after 1 week
604800) ; Default TTL
;      IN      NS      IN      NS      IN      MX      10      IN      A
mail                    IN      A
www                     IN      CNAME
ftp                     IN      CNAME IN      TXT     "v=spf1 ip192.168.0.10 a mx ~all"
mail                    IN      TXT     "v=spf1 a -all"

Leave a Reply

Your email address will not be published. Required fields are marked *