Kamis, 27 Mei 2010

CARA KONFIGURASI 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.6;

};

  • 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.6

netmask 255.255.255.0

gateway 192.168.1.1

  • Mapping DNS :

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

zone "diana.com" {

type master;

file "/etc/bind/db.diana.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.diana.com

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

$TIL 604800

@ IN SOA diana.com. root.diana.com. (

3 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS diana.com.

@ IN AAAA ::1

IN A 192.168.1.6

www IN A 192.168.1.6

ftp IN CNAME diana.com.

mail IN A 192.168.1.6

  • 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 diana.com. root.diana.com. (

3 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS diana.com.

7 IN PTR www.diana.com.

7 IN PTR mail.diana.com.

· Set nameserver :

nano /etc/resolv.conf, isikan ini :

search diana.com.

nameserver 192.168.1.6

· Set IP local host dan host :

nano /etc/hosts, isikan seperti ini :

127.0.0.1 localhost

192.168.1.6 diana.com.

127.0.1.1 diana1-PC

· Sekarang coba test domain yang telah kita buat :

/etc/init.d/networking restart

/etc/init.d/bind9 restart

nslookup diana.com