DNS Server Linux di RHEL 5


Sebelum melakukan  configurasi DNS Server pada Linux Red Hat Enterprise 5, hal yang perlu di ingat yaitu paket yang di butuhkan dipastikan sudah terinstall dengan baik. Paket2 tersebut yaitu : bind-devel, bind-chroot, ypbind, bind-utils, bind, bind-libs, caching-nameserver  Untuk melihat paket tersebut sdh terinstall di linux anda lakukan perintah  pada root #rpm -qa | grep bind. Pada Linux RHEL 5 untuk configurasi DNS Server semua ada pada directory /var/named/chroot/

  • vim /var/named/chroot/etc/named.conf

# Template file for BIND labs.
# Remember to replace each X with your station number!
# Please note three different comment styles are used for
# illustrative purposes only

options {
directory “/var/named”;
// We’re forwarding DNS requests to server1.example.com
// and letting it talk to the root name servers; if it
// fails to respond, we *don’t* want to talk to the root
// name servers directly.
forwarders { 202.51.209.5; };
forward only;
auth-nxdomain no;
};
// Magic to make rndc work
include “/etc/rndc.key”;
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

[root@server1 etc]# vim /var/named/chroot/etc/named.conf
[root@server1 etc]#
[root@server1 etc]# more /var/named/chroot/etc/named.conf
# /etc/named.conf
#
# Template file for BIND labs.
# Remember to replace each X with your station number!
# Please note three different comment styles are used for
# illustrative purposes only

options {
directory “/var/named”;
// We’re forwarding DNS requests to server1.example.com
// and letting it talk to the root name servers; if it
// fails to respond, we *don’t* want to talk to the root
// name servers directly.
forwarders { 202.51.209.5; };
forward only;
auth-nxdomain no;
};
// Magic to make rndc work
include “/etc/rndc.key”;
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

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

zone “localhost” {
type master;
file “localhost.zone”;
};

zone “0.0.127.in-addr.arpa” {
type master;
file “127.0.0.zone”;
};

/* REPLACE X HERE WITH YOUR STATION NUMBER
* MAKE SURE YOU RENAME THE FILE WHEN YOU ARE DONE */
zone “ss-911.com” {
type master;
file “nawakara.org.zone”;
};

/* REPLACE X HERE WITH YOUR STATION NUMBER
* MAKE SURE YOU RENAME THE FILE WHEN YOU ARE DONE */
zone “1.1.168.192.IN-ADDR.ARPA” {
type master;
file “192.168.1.146.zone”;
};

  • vim /var/named/chroot/var/named/nawakara.org.zone

; Replace all X(s) with your station number
; Be careful not to replace the X in the MX RR

$TTL 86400
@ IN  SOA ss-911.com. root.ss-911.com. (
; Dont forget to increment the serial number
2003040100      ;serial number
1H              ;refresh slave
5M              ;retry refresh
1W              ;expire zone
5M              ;cache time-to-live for negative answers
)
; Name server resource records ( NS )
; owner                 TTL     CL  type        RDATA
@                               IN  NS          ss-911.com.

; Mail exchanger resource records ( MX )
; owner                 TTL     CL  type RDATA
ss-911.com.             IN  MX   10 server1.ss-911.com.

; Internet address resource records( A )
; owner                 TTL     CL  type        RDATA
@                               IN  A           192.168.1.1
;forum.ss-911.com.              IN  A           192.168.1.1

http://www.ss-911.com.                 IN  A           202.145.6.64

  • vim /var/named/chroot/var/named/192.168.1.146.zone

; Replace all X(s) with your station number
$TTL 86400
@ IN SOA ss-911.com. root.ss-911.com. (
; Don’t forget to increment the serial number
2003040100      ;serial number
1H              ;refresh slave
5M              ;retry refresh
1W              ;expire zone
5M              ;cache time-to-live for negative answers
)

; owner                 TTL     CL  type        RDATA

@                               IN  NS          ss-911.com.

1.1.168.192.IN-ADDR.ARPA.       IN  PTR         ss-911.com.
;9.1.168.192.IN-ADDR.ARPA.      IN  PTR         mail.ss-911.com.

Jika sudah berubah files2  diatas, jalankan bind dengan perintah

#chown root.named /var/named/chroot/etc/ *

#chown root.named /var/named/chroot/var/ *

#/etc/init.d/named start

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