[Tutorial] : Installasi Bind di Centos

Author: Rhesa Mahendra.

Installasi Bind di Centos

Bind merupakan salah satu applikasi dengan pengguna paling banyak yang digunakan sebagai DNS Server, DNS (Domain Name System) digunakan untuk melakukan translate dari IP address menjadi sebuah nama domain, bisa dicontohkan sebagai berikut, semua domain maupun subdomain yang ada di internet merupakan hasil translate dari sebuah IP address, ketika sebuah domain dengan nama yahoo.com tidak di translate dari IP adress bayangkan kita mesti mengingat seluruh IP address yang digunakan di seluaruh internet, dan itu akan sangat merepotkan semua orang, dan BIND ini merupakan applikasi yang digunakan untuk melakukan translate tersebut, dibawah ini kita akan coba melakukan installasi BIND server sebagai DNS server di atas OS Centos, langsung saja kita mulai : 1. Check Paket yang tersedia : [root@contoh named]# rpm -qa bind* bind-libs-9.2.4-2 bind-utils-9.2.4-2 bind-9.2.4-2 2. Setting Komputer 1 Menggunakan NS1 dengan IP 192.168.0.1 [root@contoh ~]# cat /etc/resolv.conf nameserver 192.168.0.1 3. Setting file /etc/named.conf [root@contoh ~]# nano /etc/named.conf // // named.conf for Red Hat caching-nameserver // options { directory /var/named; dump-file /var/named/data/cache_dump.db; statistics-file /var/named/data/named_stats.txt; /* * 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 uses an unprivileged * port by default. */ // query-source address * port 53; }; // // a caching only nameserver config // controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; zone localhost IN { type master; file localhost.zone; allow-update { none; }; }; zone contoh.com IN { type master; file /var/named/contoh.com.zone; allow-update { none; }; }; zone 0.168.192.in-addr.arpa IN { type master; file /var/named/0.168.192.rev; allow-update { none; }; }; include /etc/rndc.key; 4. Buat file yang akan digunakan sebagai domain kita (misal contoh.com) [root@contoh ~]# nano /var/named/contoh.com.zone $TTL 86400 @ IN SOA contoh.com. root.contoh.com. ( 100 ; serial 1H ; refresh 1M ; retry 1W ; expiry 1D ) ; minimum @ IN NS ns1.contoh.com. @ IN A 192.168.0.1 ns1 IN A 192.168.0.1 @ IN MX 10 mail.contoh.com. mail IN A 192.168.0.1 WWW IN A 192.168.0.1 4. Setelah semua konfigurasi dibuat, bisa melakukan restart service Bind [root@contoh ~]# /etc/init.d/named restart Stopping named: . [ OK ] Starting named: [ OK ] 5. Kita bisa melakukan pengecekan dengan cara [root@contoh ~]# nslookup contoh.com Server: 192.168.0.1 Address: 192.168.0.1#53 Name: contoh.com Address: 192.168.0.1 6. Dari Step No.5 bind sudah bekerja dengan baik, IP 192.168.0.1 di translate menjadi domain contoh.com, untuk lebih jelas bisa kita coba dengan menggunakan dig [root@contoh ~]# dig contoh.com ; DiG 9.2.4 contoh.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10576 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ;contoh.com. IN A ;; ANSWER SECTION: contoh.com. 86400 IN A 192.168.0.1 ;; AUTHORITY SECTION: contoh.com. 86400 IN NS ns1.contoh.com. ;; ADDITIONAL SECTION: ns1.contoh.com. 86400 IN A 192.168.0.1 ;; Query time: 8 msec ;; SERVER: 192.168.0.1#53(192.168.0.1) ;; WHEN: Sat Aug 2 10:56:16 2008 ;; MSG SIZE rcvd: 85 7. Berikut adalah output untuk melihat hasil dari log DNS [root@contoh ~]# tail /var/log/messages Aug 2 10:53:57 contoh named[20094]: listening on IPv4 interface venet0:0, 192.168.0.1#53 Aug 2 10:53:57 contoh named[20094]: command channel listening on 127.0.0.1#953 Aug 2 10:53:57 contoh named[20094]: zone 0.168.192.in-addr.arpa/IN: loaded serial 100 Aug 2 10:53:57 contoh named[20094]: zone contoh.com/IN: loaded serial 100 Aug 2 10:53:57 contoh named[20094]: zone localhost/IN: loaded serial 42 Aug 2 10:53:57 contoh named[20094]: running Aug 2 10:53:57 contoh named[20094]: zone contoh.com/IN: sending notifies (serial 100) Aug 2 10:53:57 contoh named[20094]: zone 0.168.192.in-addr.arpa/IN: sending notifies (serial 100) Aug 2 10:53:57 contoh named[20094]: received notify for zone contoh.com Aug 2 10:53:57 contoh named[20094]: received notify for zone 0.168.192.in-addr.arpa Selamat Mencoba !!
visit our other blog: Cloud Indonesia

Tidak ada komentar:

Posting Komentar