Skip to content

SETTING DNS SERVER

August 12, 2007

SETTING DNS SERVER di localhost

pertama, cek BIND, apakah sudah terinstall :

[root@lp3tnf13 ~]# rpm -qa | grep bind
bind-utils-9.3.2-8mdv2007.0
bind-9.3.2-8mdv2007.0

[root@lp3tnf13 ~]# vi /etc/named.conf

zone “.” IN {
        type hint;
        file “named.ca”;
};

zone “localdomain” IN {
        type master;
        file “master/localdomain.zone”;
        allow-update { none; };
};

zone “localhost” IN {
        type master;
        file “master/localhost.zone”;
        allow-update { none; };
};

zone “0.0.127.in-addr.arpa” IN {
        type master;
        file “reverse/named.local”;
        allow-update { none; };
};
blabla…tambahkan konfigurasi berikut :
zone “fadhil.nf.ok” IN {
        type master;
        file “master/fadhil.nf.ok.zone”;
        allow-update { none; };
};
kemudian save

tambahkan zone untuk konfigurasi diatas yang bernama fadhil.nf.ok.zone

[root@lp3tnf13 ~]# vi /var/lib/named/var/named/master/fadhil.nf.ok.zone
$TTL    86400
@               IN SOA  ns.fadhil.nf.ok. root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           ns.fadhil.nf.ok.
                IN MX 10        mail.fadhil.nf.ok.
www             IN A            192.168.1.13
webmail         IN A            192.168.1.13

kemudian save

[root@lp3tnf13 ~]# vi /etc/resolv.conf 
tambahkan atau disable semua ns kecuali
nameserver 192.168.1.13

Cek dns, ada 3 cara :
1. Host http://www.fadhil.nf.ok
2. nslookup http://www.fadhil.nf.ok
3. dig http://www.fadhil.nf.ok any

lalu bagaimana cara setting DNS server di server LAN

dgn menggunakan cara yang sama seperti diatas

[root@server ~]# vi /etc/named.conf
tambahkan
zone “nf.ok” IN {
        type master;
        file “master/nf.ok.zone”;
        allow-update { none; };
};

save

tambahkan zone

[root@lp3tnf14 ~]# vi /var/lib/named/var/named/master/nf.ok.zone
$TTL    86400
@               IN SOA  ns.nf.ok.       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                IN NS           ns.nf.ok.
                IN MX 10        mail.nf.ok.
mail            IN A            192.168.1.14
www             IN A            192.168.1.14
webmail         IN A            192.168.1.14
blog            IN A            192.168.1.14
yogi.nf.ok.      IN NS          ns.yogi.nf.ok.
ns.yogi.nf.ok.  IN A            192.168.1.12
anto.nf.ok.      IN NS          ns.anto.nf.ok.
ns.anto.nf.ok.  IN A            192.168.1.11
fadhil.nf.ok.   IN NS           ns.fadhil.nf.ok. >>>>
ns.fadhil.nf.ok. IN A           192.168.1.13 >>>>>>>>
http://www.fadhil.nf.ok. IN A          192.168.1.13
gamal.nf.ok.    IN      NS      ns.gamal.nf.ok.
ns.gamal.nf.ok. IN A            192.168.1.18
kuni.nf.ok.     IN NS           ns.kurni.nf.ok.
ns.kurni.nf.ok. IN A            192.168.1.17

save

[root@server ~]# vi /etc/resolv.conf 
tambahkan atau disable semua ns kecuali ns server
nameserver 192.168.1.14

cek dengan host, nslookup, dan dig

notes :
ingat file yg berada di zone (milik group root) harus menjadi named group,untuk mengubahnya :
chown -R root.named nama_file_zone

untuk mendisable firewall :
service iptables stop

untuk men-clear shorewall :
shorewall clear

Powered by ScribeFire.

From → Linux

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: