ads


Low Resource DNS NAME SERVER Using NSD

if we have Very Cheap VPS thats mean we only have low memory. with low memory we didnt need big resource and we must optimize memory VPS. this is tutorial for centos how to configuration DNS NameServer using NSD.

Before we start install NSD we use EPEL REPO First.

CentOS 6: rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
CentOS 5: rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Now install IPTABLES if you dont have and then install NSD :

yum install nsd iptables
chkconfig nsd on

after we have installation IPTABLES now configure

iptables -A INPUT -p udp --dport 53 -j ACCEPT

Save your NSD.CONF before continue this :

cp /etc/nsd/nsd.conf /etc/nsd/nsd.conf.dist
edit nsd.conf
# The 'server:' section is the configuration for the DNS server
server:
    # this is the IP address it will listen on for DNS requests
    # change this to the public-facing IP address of your VPS
    ip-address: 1.23.45.67

    # no need to tell people what version we're running
    hide-version: yes

    # the database to use
    database: "/var/lib/nsd/nsd.db"

    # log file
    logfile: "/var/log/nsd.log"

    # Number of NSD servers to fork.
    server-count: 1

# we'll use a separate "zone list" file to make rsync easier
include: "/etc/nsd/zones/my_zone.conf"
check the last text, that’s saying my_zone.conf, now we must create that file location and configure this. use nano editor
mkdir /etc/nsd/zones

nano /etc/nsd/zones/my_zone.conf
MY_ZONE.CONF like this
zone:
    name: example.com
    zonefile: /etc/nsd/zones/example.com
now you have zone domain configuration dns. but you dont have zonefile and we must create /etc/nsd/zones/example.com next step is :
nano /etc/nsd/zones/example.com

copy this script to /etc/nsd/zones/example.com

$ORIGIN example.com.
$TTL 3600

@    IN     SOA     ns1.example.com. admin.example.com. (
           2011102301  ; serial number
           28800       ; Refresh
           7200        ; Retry
           864000      ; Expire
           86400       ; Min TTL
           )

                IN    NS      ns1.example.com.
                IN    NS      ns2.example.com.

ns1           IN     A        12.34.56.78
ns2           IN     A        12.34.56.79
vps       IN     A        12.34.56.78
www         IN     CNAME vps

Centos 5 :

now rebuild and start nsd :

nsdc rebuild
/etc/init.d/nsd start

now we have done. this is very basic and simply how to install NSD also how to using NSD as your DNS with low resource memory and cpu

Leave a Reply:

You must be logged in to post a comment.