Setting Nameserver Based For Domain

by admin on February 21, 2011

in Http Maid Note

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 and and point both nameservers to your ip address(es)

Install Webmin using 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

name=Webmin Distribution Neutral

add Webmin GPG key and install Webmin

rpm --import
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:
Records file: Automatic
Master server: – 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:
Time-To-Live: Default
Name Server:

– 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”

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

Time-To-Live: Default
Address: your server ip address

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

Time-To-Live: Default
Address: your 1st server ip address

Time-To-Live: Default
Address: your 2nd server ip address

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”

Time-To-Live: Default
Real Name:

– 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.

{ 5 comments… read them below or add one }

Leave a Comment

Previous post:

Next post: