Instalasi dan Konfigurasi DNS Server Menggunakan Bind 9 pada Ubuntu 6.06 (Dappe Drake)

Domain Name System (DNS) adalah sebuah sistem yang berfungsi menerjemahkan alamat IP menjadi nama domain. Misalnya, sebuah komputer/server dengan IP (public) 209.131.36.158 memiliki nama domain http://www.yahoo.com, sehingga end user tidak perlu mengingat alamat IP dari server tersebut yang pasti lebih sulit untuk diingat. Cukup dulu penjelasan singkat mengenai DNS server, keterangan lebih lanjut silahkan baca di sini.

Step 1: Edit File /etc/apt/sources.list:

sudo nano /etc/apt/sources.list

Repository yang digunakan pada tutorial kali ini adalah :

deb http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ dapper main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu/ dapper-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ dapper-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ dapper-proposed universe main multiverse restri

Step2: Install bind 9:

sudo apt-get install bind9

Step 3: Konfigurasi Bind. Jika instalasi Bind menggunakan paket source maka file konfigurasi akan terletak pada named.conf. Berbeda dengan Ubuntu yang telah melakukannya untuk kita. Jadi file yang akan kita edit adalah named.conf.local

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

Disini kita akan memasukkan zones. Zones adalah suatu nama domain yang me-refer ke DNS server.
Edit file /etc/bind/named.conf.local :

# This is the zone definition. replace example.com with your domain name
zone "example.com" {
    type master;
    file "/etc/bind/zones/example.com.db";
    };

# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
 type master;
 file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};

Edit file /etc/bind/named.conf.options:

sudo nano /etc/bind/named.conf.options

Kita harus mengubah nilai forwarder. Ketika request tak dapat dipenuhi oleh DNS server kita, maka request tersebut akan di forward ke DNS server berikut.

forwarders {
  # Replace the address below with the address of your provider's DNS server
  10.14.1.37;
  10.14.203.7
};

Kemudian lihat file zones ganti example.com dengan nama domain:

sudo mkdir /etc/bind/zones
sudo vi /etc/bind/zones/example.com.db

File zone berisi padanan ip dengan nama domain yang diberikan, seperti contoh berikut.

// replace example.com with your domain name. do not forget the . after the domain name!// Also, replace ns1 with the name of your DNS server
example.com.      IN      SOA     ns1.example.com. admin.example.com. (
// Do not modify the following lines!
                                                    2006081401
                                                    28800
                                                    3600
                                                    604800
                                                    38400
)

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com.      IN      NS              ns1.example.com.
example.com.      IN      MX     10       mta.example.com.

// Replace the IP address with the right IP addresses.

www              IN      A       192.168.0.2
mta              IN      A       192.168.0.3
ns1              IN      A       192.168.0.1

Kemudian buat file reverse DNS zone:

sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa

Copy dan paste teks berikut:

//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1.
@ IN SOA ns1.example.com. admin.example.com. (
                    2006081401;
                    28800;
                    604800;
                    604800;
                    86400
)

                 IN    NS     ns1.example.com.
1                    IN    PTR    example.com

Selesai, restart DNS server:

sudo /etc/init.d/bind9 restart

Step 4: Edit file resolv.conf seperti berikut:

sudo vi /etc/resolv.conf

masukkan baris berikut:

// replace example.com with your domain name, and 192.168.0.1 with the address of your new DNS server.search example.com
nameserver 192.168.0.1

Test DNS server:

dig example.com

Selamat!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: