Membuat DNS & Konfigurasi DNS Server Pada

DNS Server pasti sudah ga asing lagi ditelinga kita.Setting dan konfigurasi DNS di Debian etch cukup simple dan sederhana :) kalau gitu kita mulai saja ketik

crazynuxer:~# apt-get install bind ---> install bind nya :)
crazynuxer:~# pico /etc/bind/named.conf ---> edit file named.conf

dan tambahkan zone nya

zone "crazynuxer.com" IN {
type master;
file "/etc/bind/crazy.db";
allow-update { none; };
};

zone "100.168.192.in-addr.arpa" IN {
type master;
file "/etc/bind/crazy-ptr.db";
allow-update { none; };
};

setelah itu bikin file crazy.db dan crazy-ptr.db tapi supaya kita ga ngetik banyak-banyak kita copy file db.local dan db.127 setelah itu tinggal ngedit

crazynuxer:~# cd /etc/bind/ ---> masuk directory /etc/bind/
crazynuxer:/etc/bind# cp db.local crazy.db--> mengcopy file db.local dan crazynuxer:/etc/bind# cp db.127 crazy-ptr.db --> mengcopi file db.127 dan crazynuxer:/etc/bind# pico crazy.db --> edit crazy.db

ganti tulisan localhost. dengan crazynuxer.com. dan ip 127.0.0.1 menjadi ip dns server dalam hal 192.168.100.1 nanti hasilnya seperti ini

;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA crazynuxer.com. root.crazynuxer.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS crazynuxer.com.
IN A 192.168.100.1

edit juga file crazy-ptr.db seperti diatasnya

crazynuxer:/etc/bind# pico crazy-ptr.db

;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA crazynuxer.com. crazynuxer.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS crazynuxer.com.
1 IN PTR crazynuxer.com.

jika sudah cek file named.conf apakah ada kesalahan configurasi

crazynuxer:/etc/bind# named-checkconf /etc/bind/named.conf

jika tidak ada pesan apa-apa maka named.conf sudah benar sekarang kita cekkonfigurasi file zone nya

crazynuxer:/etc/bind# named-checkzone crazynuxer.com /etc/bind/crazy.db
zone crazynuxer.com/IN: loaded serial 1
OK
crazynuxer:/etc/bind# named-checkzone 100.168.192.in-addr.arpa /etc/bind/crazy-ptr.db
zone 100.168.192.in-addr.arpa/IN: loaded serial 1
OK

jika sudah ok kita restart bind

crazynuxer:/etc/bind# /etc/init.d/bind9 restart

setelah itu kita test DNS nya apakah berjalan dengan baik dengan perintah dig dan nslookup

crazynuxer:/etc/bind# dig crazynuxer.com

; <<>> DiG 9.3.4 <<>> crazynuxer.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16192
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;crazynuxer.com. IN A

;; ANSWER SECTION:
crazynuxer.com. 604800 IN A 192.168.100.1

;; AUTHORITY SECTION:
crazynuxer.com. 604800 IN NS crazynuxer.com.

;; Query time: 0 msec
;; SERVER: 202.123.235.26#53(202.123.235.26)
;; WHEN: Wed Dec 5 16:17:57 2007
;; MSG SIZE rcvd: 57

jika ada status : NOERROR maka DNS telah berhasil dikonfigurasi sekarang kita tinggal test dengan perintah nslookup

crazynuxer:/etc/bind# nslookup -sil
> crazynuxer.com
Server: 192.168.100.1
Address: 192.168.100.1#53

Name: crazynuxer.com
Address: 192.168.100.1

> exit

crazynuxer:/etc/bind#

jika tampilan seperti diatas maka DNS sudah selesai dikonfigurasi dan siap digunakan :D

Tidak ada komentar: