Selasa, 06 Oktober 2009

Setting DNS Linux Debian 4.0 etch

Setting DNS

mmencari paket DNS server (Bind9) yang tersedia pada cache


$ apt-cache search bind9

$ apt-get install bind9


Langkah awal adalah melakukan konfigurasi file hostname untuk memberi nama computer DNS


$ vi /etc/hostname

Misalnya computer DNS diberi nama V-DDNS


Kemudia konfigurasi file hosts


$ vi /etc/hosts


127.0.0.1 localhost.localdomain localhost V-DDNS ns

10.252.100.60 V-DDNS


# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts


langkah selanjutnya adalah melakukan konfigurasi file-file yang ada pada /etc/bind, file-file tersebut adalah sebagai berikut


  • named.conf ; penunjuk file konfigurasi (include)

  • named.conf.local ; konfigurasi IP & Nama Domain dari DNS

  • named.conf.options ; konfigurasi aturan DNS,forward & port


masih banyak lagi file-file konfigurasi DNS pada /etc/bind, namun file yang perlu dilakukan konfigurasi cukup 2 file, yaitu

  • named.conf.local

  • named.conf.options


$ vi /etc/bind/named.conf.local


//

// Do any local configuration here

//


// Consider adding the 1918 zones here, if they are not used in your

// organization

//include "/etc/bind/zones.rfc1918";



zone "eightsun.net" IN {

type master;

file "/var/cache/bind/db.eightsun.net";

allow-query {any;};

allow-transfer {127.0.0.1;};

};

//reverse

zone "100.252.10.in-addr.arpa" IN {

type master;

file "/var/cache/bind/db.10.252.100";

};


Pada konfigurasi diatas adalah menunjuk file db.nguprex pada directory /var/cache/bind/ sebagai file konfigurasi DNS pada Domain


$ vi /etc/bind/named.conf.options


options {

directory "/var/cache/bind";


// If there is a firewall between you and nameservers you want

// to talk to, you might need to uncomment the query-source

// directive below. Previous versions of BIND always asked

// questions using port 53, but BIND 8.1 and later use an unprivileged

// port by default.


query-source address * port 53;


// If your ISP provided one or more IP addresses for stable

// nameservers, you probably want to use them as forwarders.

// Uncomment the following block, and insert the addresses replacing

// the all-0's placeholder.


forwarders {

0.0.0.0;

};


auth-nxdomain no; # conform to RFC1035


};


Selanjutnya adalah membuat file configurasi yang bernama db.nguprex dan db.10.252.100 seperti yang telah tercantum pada file named.conf.local di directory /etc/bind/


$ vi /var/cache/bind/db.eightsun.net


;

; BIND data file for local loopback interface

;

$TTL 604800

@ IN SOA ns.nguprex.net. root.eightsun.net. (

1 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;


IN NS ns.eightsun.net.

IN MX 10 postfix.nguprex.net.


ns IN A 10.252.100.60

postfix IN A 10.252.100.25

apache IN A 10.252.100.80

proftpd IN A 10.252.100.21

samba IN A 10.252.100.22

dialproxy IN A 10.252.100.70


mail IN CNAME postfix

pop3 IN CNAME postfix

smtp IN CNAME postfix

imap IN CNAME postfix

www IN CNAME apache

fileserver IN CNAME samba

ftp IN CNAME proftpd

proxy IN CNAME dialproxy




$ vi /var/cache/bind/db.10.252.100


;

; BIND data file for local loopback interface

;

$TTL 604800

@ IN SOA ns.eightsun.net. root.eightsun.net. (

1 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; minimum

;


IN NS ns.eightsun.net.

IN MX 10 postfix.eightsun.net.


60 IN PTR ns.eightsun.net.

80 IN PTR apache.eightsun.net.

21 IN PTR proftpd.eightsun.net.

22 IN PTR fileserver.eightsun.net.

25 IN PTR postfix.eightsun.net.

70 IN PTR dialproxy.eightsun.net.


Setetlah melakukan konfgurasi file-file diatas maka DNS telah dapat bekerja, untuk melihat hasilnya lakukan restart service bind


$ /etc/ini.d/bind restart

$ vi /etc/resolv.conf


Di isi

nameserver IP_DNS_SERVER

nameserver 10.252.100.60


Setelah itu lihat hasilnya dengan perintah nslookup sebagai berikut


$ nslookup www.eightsun.net

$ nslookup ftp.eightsun.net

$ nslookup mail.nguprex.net

$ nslookup 10.252.100.60

$ nslookup 10.252.100.80





Posting Komentar

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search