Senin, 31 Desember 2012

Konfigurasi DNS Server pada Debian 6 (Squeeze)


Konfigurasi DNS Server pada Debian 6 (Squeeze).
Tanpa basa-basi lagi, inilah langkah-langkahnya :

1. Install paket DNS Server dengan memasukan perintah
root@iqy:/home/iqy# apt-get install bind9
2. Masuk ke direktory Bind
root@iqy:/home/iqy# cd /etc/bind
3. Lihat semua file/data yang ada di direktory Bind
root@iqy:/etc/bind# ls
bind.keys   db.empty         named.conf.default-zones  zones.rfc1918
db.0           db.local           named.conf.local
db.127       db.root            named.conf.options
db.255       named.conf      rndc.key
4. Lakukan konfigurasi denga memasukan perintah :
root@iqy:/etc/bind# nano named.conf.default-zones
// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";

};
zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

5. Ubah scriptnya dari :
zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";

};

Menjadi :
zone "iqy.com" {    // DNS Name Server
        type master;
        file "db.iqy";               // Database untuk DNS Name Server
};

zone "192.in-addr.arpa" {        // IP Address pertama
        type master;
        file "db.192";                   // Database untuk IP Address

};
Setelah selsai Ctrl + x lalu y & enter

6. Salin db.127 & db.local dengan perintah :
root@iqy:/etc/bind# cp db.127 db.192
root@iqy:/etc/bind# cp db.local db.iqy
7. Pindahkan hasil salinan ke direktory /var/cache/bind
root@iqy:/etc/bind# mv db.192 db.iqy /var/cache/bind
8. Masuk ke direktory /var/cache/bind dan lihat hasilnya
root@iqy:/etc/bind# cd /var/cache/bind
root@iqy:/var/cache/bind# ls
db.192    db.iqy
9. Lakukan pengeditan kedua database tersebut diatas
root@iqy:/var/cache/bind# nano db.192
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                                   1         ; Serial
                         604800         ; Refresh
                           86400         ; Retry
                       2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@        IN      NS       localhost.
1.0.0    IN      PTR     localhost.

Ubah script menjadi :
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     iqy.com. root. iqy.com. (
                                   1         ; Serial
                         604800         ; Refresh
                           86400         ; Retry
                       2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@                 IN      NS        iqy.com.    // DNS Name Server
200.27.1       IN      PTR      iqy.com.    // DNS Name Server

Ctrl + x lalu y & enter

root@iqy:/var/cache/bind# nano db.iqy ;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                                   1         ; Serial
                         604800         ; Refresh
                           86400         ; Retry
                       2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@               IN      NS      localhost.
@               IN      A        127.0.0.0

Ubah script menjadi :
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA      iqy.com. root. iqy.com. (
                                           ; Serial
                         604800         ; Refresh
                           86400         ; Retry
                       2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@        IN      NS       iqy.com.    // DNS Name Server
@        IN      A        192.200.27.1              // IP Address
www    IN      A        192.200.27.1              // IP Address

Ctrl + x lalu y & enter

10. Lakukan Restart untuk Bind
root@iqy:/var/cache/bind# /etc/init.d/bind9 restart
11. Install paket DNS Server yang lainnya
root@iqy:/var/cache/bind# apt-get install apache2 php5
12. Lihat apakah konfigurasi telah berhasil dengan perintah nslookup
root@iqy:/var/cache/bind# nslookup iqy.com
Server:        192.200.27.1
Address:     192.200.27.1#53

Name:          iqy.com
Address:      192.200.27.1

Tidak ada komentar:

Posting Komentar