Selasa, 25 Mei 2010

Konfigurasikan DNS di Ubuntu

  • Installasi paket :

apt-get install bind9

apt-get install dnsutils


  • Konfigurasikan IP forward :

nano /etc/bind/named.conf.options

hapus tanda double slash (//),

forwarders {

192.168.1.4;

};

  • Setelah itu buat IP address pada interface eth0 ( konfigurasi IP static) :

nano /etc/network/interfaces, isikan seperti ini :

iface eth0 inet static

address 192.168.1.4

netmask 255.255.255.0

gateway 192.168.1.1


  • Mapping DNS :

nano /etc/bind/named.conf.local, isikan seperti ini :

zone "diani.com" {

type master;

file "/etc/bind/db.diani.com";

};

zone "1.168.192.in-addr.arpa" {

type master;

file "/etc/bind/db.192";

};

  • Tahap berikutnya pemberian nama DNS :

cp /etc/bind/db.local /etc/bind/db.diani.com


nano /etc/bind/db.diani.com, isikan seperti ini :

$TIL 604800

@ IN SOA diani.com. root.diani.com. (

3 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS diani.com.

@ IN AAAA ::1

IN A 192.168.1.4

www IN A 192.168.1.4

ftp IN CNAME diani.com.

mail IN A 192.168.1.4



  • Set IP buat DNS yang kita buat :

cp /etc/bind/db.127 /etc/bind/db.192

nano /etc/bind/db.192, isikan ini :

$TIL 604800

@ IN SOA diani.com. root.diani.com. (

3 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS diani.com.

7 IN PTR www.diani.com.

7 IN PTR mail.diani.com.


  • Set nameserver :

nano /etc/resolv.conf, isikan ini :

search diani.com.

nameserver 192.168.1.4



  • Set IP local host dan host :

nano /etc/hosts, isikan seperti ini :

127.0.0.1 localhost

192.168.1.4 diani.com.

127.0.1.1 diani1-PC

  • Sekarang coba test domain yang telah kita buat :

/etc/init.d/networking restart

/etc/init.d/bind9 restart

nslookup diani.com