Konfigurasi DNS di CentOS 6

Pertama install web server

yum install httpd

kedua install bind

yum install bind bind-utils -y

edit konfigurasi named.conf yang terletak pada directory /etc dengan membuatkan zone forward dan zone reverse dengan mengetikkan perintah

nano /etc/named.conf

kemudian isikan configurasi seperti berikut, sesuaikan. terserah kamu, asal bener 😀

Note:
ip saya: 192.168.1.25
domain: tkj.id

options {
listen-on port 53 { 127.0.0.1; 192.168.1.25; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;

allow-query { 127.0.0.1; 192.168.1.25; any; };
allow-query-cache { 127.0.0.1; 192.168.1.25; any;};
};

logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};

zone “tkj.id” {
type master;
file “/etc/named/tkj.zone”;
};

zone “1.168.192.in-addr.arpa” IN {
type master;
file “/etc/named/ip.rev”;
allow-update { none; };
};

namedconf

Membuat file zone forward

$TTL    86400
@	IN	SOA	tkj.id. root.tkj.id.(
                               2008111914	;Serial
                                3600            ;Refresh
                                1800            ;Retry
                                604800          ;Expire
                                86400           ;Minimum TTL
)

@                               IN	NS	ns1.tkj.id.
@                               IN	NS	ns2.tkj.id.
@                               IN	A	192.168.1.25
ns1                             IN	A	192.168.1.25
ns2                             IN	A	192.168.1.25
@                               IN	MX  10  mail.tkj.id.                
www				IN	A	192.168.1.25
mail                            IN      A       192.168.1.25

forward

Membuat file zone reverse

 

$TTL    86400
@               IN SOA          tkj.id. root.tkj.id. (                         2008111914      ;Serial
                3600            ;Refresh
                1800            ;Retry
                604800          ;Expire
                86400           ;Minimum TTL
)

                IN NS            ns1.tkj.id.
                IN NS            ns2.tkj.id.
25              IN PTR           tkj.id. 

note: 25 adalah akhir segmen dari ip saya (192.168.1.25)

reverse

Selanjutnya restart service bind dengan mengetikkan perintah

service named restart

named

Kalo konfigurasi nya udah oke, pasti muncul kaya yang di atas hehe 😀

Untuk memastikanya lagi, kita bisa menggunakan nslookup.

nslookup

Terakhir, saya cek di sisi client. Konfigurasi dulu dns nya, arah kan ke server.

tkjid

Advertisements

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