Monday, February 9, 2009

Membuat DNS Server

DNS SERVER

(DOMAIN NAME SYSTEM)

Fungsi:

  1. Merubah Hostname menjadi IP dan IP menjadi Hostname

Langkah Membuat DNS

  1. Setting IP DNS Server

    #vim /etc/network/interfaces
    iface eth0 inet static

address 192.168.2.44

netmask 255.255.255.128

broadcast 192.168.2.63

network 192.168.2.0

gateway 192.168.2.1

esc:wq

#/etc/init.d/networking restart

  1. Install bind9

    #apt-get install bind9

  2. Melakukan Konfigurasi

Membuat Zone
#vim /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.

//

// Please read /usr/share/doc/bind9/README.Debian.gz for information on the

// structure of BIND configuration files in Debian, *BEFORE* you customize

// this configuration file.

//

// If you are just adding zones, please do that in /etc/bind/named.conf.local

include “/etc/bind/named.conf.options”;

// prime the server with knowledge of the root servers

zone “.” {

type hint;

file “/etc/bind/db.root”;

};

// be authoritative for the localhost forward and reverse zones, and for

// broadcast zones as per RFC 1912

zone “localhost” {

type master;

file “/etc/bind/db.local”;

};

zone “127.in-addr.arpa” {

type master;

file “/etc/bind/db.127″;

};

zone “0.in-addr.arpa” {

type master;

file “/etc/bind/db.0″;

};

zone “255.in-addr.arpa” {

type master;

file “/etc/bind/db.255″;

};

zone “stm.com” {

type master;

file “/etc/bind/db.stm”;

};

zone “2.168.192.in-addr.arpa” {

type master;

file “/etc/bind/rev.stm”;

};

// zone “com” { type delegation-only; };

// zone “net” { type delegation-only; };

// From the release notes:

// Because many of our users are uncomfortable receiving undelegated answers

// from root or top level domains, other than a few for whom that behaviour

// has been trusted and expected for quite some length of time, we have now

// introduced the “root-delegations-only” feature which applies delegation-only

// logic to all top level domains, and to the root domain. An exception list

// should be specified, including “MUSEUM” and “DE”, and any other top level

// domains from whom undelegated responses are expected and trusted.

// root-delegation-only exclude { “DE”; “MUSEUM”; };

include “/etc/bind/named.conf.local”;

Mengisi zone stm.com

#cp /etc/bind/db.local /etc/bind/db.stm

#vim /etc/bind/db.stm;

; BIND data file for local loopback interface

;

$TTL 60480

@ IN SOA stm.com. root.stm.com. (

1 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS stm.com.

@ IN A 192.168.2.44

esc:wq

Mengisi zone rev.stm

#cp /etc/bind/db.127 /etc/bind/rev.stm

#vim /etc/bind/rev.stm

;

; BIND reverse data file for local loopback interface

;

$TTL 604800

@ IN SOA stm.com. root.stm.com. (

1 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS stm.com.

44 IN PTR stm.com.

esc:wq

  1. Restart bind9

    #/etc/init.d/bind9 restart

  2. Mengubah DNS Client

#vim /etc/resolv.conf

search stm.com

nameserver localhost

nameserver 192.168.2.44

esc:wq

  1. Menguji DNS

#nslookup
> localhost

Server: 192.168.2.44

Address: 192.168.2.44#53

Name: localhost

Address: 127.0.0.1

> 127.0.0.1

Server: 192.168.2.44

Address: 192.168.2.44#53

1.0.0.127.in-addr.arpa name = localhost.

> stm.com

Server: 192.168.2.44

Address: 192.168.2.44#53

Name: stm.com

Address: 192.168.2.44

> 192.168.2.44

Server: 192.168.2.44

Address: 192.168.2.44#53

44.2.168.192.in-addr.arpa name = stm.com.

(Dikutip dari smkn1-tuban.sch.id)

No comments:

Post a Comment