how to setting dns server

Sep 15th, 2009 | Posted by

pertama install bind9 :

user@computer:$ sudo apt-get install bind9

kemudian tambahkan zone pada file /etc/bind/named.conf :

user@computer:$ sudo vim /etc/bind/named.conf

zone "cuplis.net" IN {
type master;
file "/etc/bind/db.cuplis-a";
allow-update { none; };
};

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

kemudian buat file db.cuplis-a dan db.cuplis-ptr di /etc/bind/ (copy aja dari db.local dan db.127) :

user@computer:$ sudo cp /etc/bind/db.local /etc/bind/db.cuplis-a
user@computer:$ sudo cp /etc/bind/db.127 /etc/bind/db.cuplis-ptr


edit file /etc/bind/db.cuplis-a, ubah localhost menjadi cuplis.net dan ip 127.0.0.1 menjadi ip 192.168.22.115 (ip dns servernya) :

user@computer:$ sudo vim /etc/bind/db.cuplis-a
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA cuplis.net. root.cuplis.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
IN NS ns1.cuplis.net.
cuplis.net. IN A 192.168.22.115
ns1.cuplis.net. IN A 192.168.22.115
@ IN AAAA ::1

dengan cara perubahan yang sama dengan perubahan di /etc/bind/db.cuplis-a, ubah file /etc/bind/db.cuplis-ptr :

user@computer:$ sudo vim /etc/bind/db.cuplis-ptr
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA cuplis.net. root.cuplis.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS cuplis.net.
1.0.0 IN PTR cuplis.net.

kemudian cek apakah ada kesalahan konfigurasi di file2 yang kita buat/ubah :

user@computer:$ sudo named-checkconf /etc/bind/named.conf

jika perintah di atas tidak menampilkan suatu pesan, berarti konfigurasi file /etc/bind/named.conf sudah benar.

user@computer:$ sudo named-checkzone cuplis.net /etc/bind/db.cuplis-a
zone cuplis.net/IN: loaded serial 2
OK
user@computer:$ sudo named-checkzone 22.168.192 /etc/bind/db.cuplis-ptr
zone 22.168.192/IN: loaded serial 1
OK

kemudian restart bind :

user@computer:$ sudo /etc/init.d/bind9 restart

lalu cek apakah dns sudah berjalan atau belum dengan menggunakan perintah berikut :

user@computer:$ dig cuplis.net
; <<>> DiG 9.4.2 <<>> cuplis.net
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44996
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;cuplis.net. IN A

;; ANSWER SECTION:
cuplis.net. 604800 IN A 192.168.22.115

;; AUTHORITY SECTION:
cuplis.net. 604800 IN NS ns1.cuplis.net.

;; ADDITIONAL SECTION:
ns1.cuplis.net. 604800 IN A 192.168.22.115

;; Query time: 0 msec
;; SERVER: 192.168.22.115#53(192.168.22.115)
;; WHEN: Wed Sep 16 12:25:26 2009
;; MSG SIZE rcvd: 78

kemudian untuk menggunakan dns ini, pada komputer client di set dns-nya ke ip dns yang sudah di setting di atas :

user@computer:$ sudo vim /etc/resolv.conf
nameserver 192.168.22.115

source : http://crazynuxer.blogdetik.com/2009/01/21/dns-server/

Related posts:

  1. setting replicate mysql
  2. how to install VMware-server-1.0.8 on Ubuntu Jaunty Jackalope
  3. setting ip dan dns di ubuntu
  4. Sedikit Masalah script/console
  5. upload file ke server pada PHP
Tags: ,
No comments yet.
*