how to setting dns server

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/

Bookmarks:
  • Facebook
  • Google Bookmarks
  • Digg
  • LinkedIn
  • Twitter

Related posts:

  1. how to install wordpress mu on nginx setting dns server tambahkan zone sarunkgenk.com di file /etc/bind/named.conf user@computer:$...
  2. ubuntu ssh-copy-id : setting ssh tanpa password sebenernya proses ssh ke mirror dapat dipercepat dengan tanpa password....
  3. how to install and configure dhcp server salah satu cara untuk configure dhcp server adalah sbb :...
  4. how to solve : vmware error while getting interfaces flag pesan error “vmware error while getting interfaces flag” muncul ketika...
  5. how to configure php as fastcgi on nginx install php user@computer:$ sudo apt-get install php5-cgi buat file...

Related posts brought to you by Yet Another Related Posts Plugin.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">