Setting Nameserver Based For Domain

Yesterday, i was looking for the way to configure nameserver in my vps, because ip based for domain name is not cool, especially if someone check my domain and it appears that my domain only using ip address or public dns, lol. Then i found out that if i want to use nameserver, i have to install and configure bind dns in my vps, so i installed bind dns and ji-o-gling about the configuration, configure this-that-here-there, and the result was failed!!! It doesn’t work hahaha… I really don’t know how to configure it, i’ve never installed and configure bind directly from source because usually i used control panel like cPanel or Direct Admin or Kloxo which has included nameserver setting. Amid confusion, i do forum-walking and found a topic about create nameserver, but they didn’t write about the tutorial, they only told that bind dns can be configured from webmin. Aha!!! I remember that there is nameserver configuration in webmin bind dns, let’s rock n roll!

Box: CentOS 5.5, 256MB memory, OpenVZ

First thing you have to do is registering your nameserver(s) in your domain registrar, usually one domain or website has two nameservers, create ns1.yourdomain.com and ns2.yourdomain.com and point both nameservers to your ip address(es)

Install Webmin using rpm

wget https://serversreview.net/pkgs/files/webmin-1.530-1.noarch.rpm
rpm -U webmin-1.530-1.noarch.rpm

Install Webmin using yum
create webmin repo for yum

nano /etc/yum.repos.d/webmin.repo

add the following lines

[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

add Webmin GPG key and install Webmin

rpm --import http://www.webmin.com/jcameron-key.asc
yum install webmin

 

Now login to your Webmin: http://yourserverip:10000
– Go to Servers menu on the left side and choose BIND DNS Server
– Choose “Setup as an internet name server, and download root server information” to create “/etc/named.conf” and push “Create Primary Configuration File and Start Nameserver” button
– Scroll down and click “Create Master Zone”

Zone type: Forward (Names to Addresses)
Domain name / Network: yourdomain.com
Records file: Automatic
Master server: ns1.yourdomain.com – also “check” Add NS record for master server
Email address: your email address
User zone template: No
IP address for template records: leave empty
Add reverses for template addresses: Yes
Refresh time: default
Expiry time: default
Transfer retry time: default
Negative cache time: default

– Click create button

– After that click Name Server in “Edit Master Zone”

Zone Name: yourdomain.com.
Time-To-Live: Default
Name Server: ns2.yourdomain.com.

– Click create button and Return to record types

Your domain has been added to BIND, now point your domain name to your server IP.

– Click Address menu in “Edit Master Zone”

Name: yourdomain.com.
Time-To-Live: Default
Address: your server ip address

– Click create button

Do again the above step for each of your nameserver. If your server has one ip address then you point all of your nameserver to your only ip address

Name: ns1.yourdomain.com.
Time-To-Live: Default
Address: your server ip address

Name: ns2.yourdomain.com.
Time-To-Live: Default
Address: your server ip address

But if you have two or more ip addresses, you can pick one ip address (just like the above) or use all of your ip addresses, just remember when registering nameserver in domain registrar, user all of ip addresses you have and add/setup all of your nameserver to BIND like the main step

Name: ns1.yourdomain.com.
Time-To-Live: Default
Address: your 1st server ip address

Name: ns2.yourdomain.com.
Time-To-Live: Default
Address: your 2nd server ip address

Additional:
If you want people to be able to access your domain using “www”, create CNAME for your domain.

– Return to record types (Edit Master Zone), click menu “Name Alias”

Name: www.yourdomain.com.
Time-To-Live: Default
Real Name: yourdomain.com.

– Restart (Stop and Start) your BIND, use the top right corner menu.

Your Nameserver Based Domain is now ready to operate. Next you can choose whether you want to use Apache or another webserver.

{ 0 comments }

5 thoughts on “Setting Nameserver Based For Domain

  1. where i can do this
    “If you want people to be able to access your domain using “www”, create CNAME for your domain.”
    on webmin or on domain registrar ?

Leave a Reply

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