Disini tidak akan dijelaskan apa itu DNS, silahkan cari di internet arti dari DNS. Sebelum mulai konfigurasi bind9 di Fedora 17 terlebih dahulu install software-software yang dibutuhkan.
yum install bind-utils bind
catatan :
domain yang akan digunakan web.lokal dengan IP 192.168.1.1
Konfigurasi
generate terlebih dahulu rdnc key dengan perintah
rndc-confgen
lalu tambahkan
zone "web.lokal" IN { type master; file "/var/named/web.lokal"; allow-update { none; }; }; zone "192.168.1.in-addr.arpa" IN { type master; file "/var/named/192.168.1.rev"; allow-update { none; }; };
dibawah
zone "." IN { type hint; file "named.ca"; };
sekarang buat zona untuk konfigurasi domain web.lokal yang terletak di /var/named/web.lokal
$TTL 86400 @ IN SOA web.lokal. root.web.lokal. ( 2012071101 ; serial 1H ; refresh 1M ; retry 1W ; expiry 1D ) ; minimum @ IN NS ns1.web.lokal. @ IN A 192.168.1.3 ns1 IN A 192.168.1.3 @ IN MX 5 mail.web.lokal. mail IN A 192.168.1.3 WWW IN A 192.168.1.3
dengan cara diatas maka domain web.lokal akan diarahkan ke IP 192.168.1 tetapi ip belum di reverse ke domain web.lokal untuk membuat reverse dns, buat file /var/named/192.168.1.rev yang berisi
$TTL 86400 @ IN SOA web.lokal. root.web.lokal. ( 2012071101 ; serial 1H ; refresh 1M ; retry 1W ; expiry 1D) ; minimum @ IN NS ns1.web.lokal. 3 IN PTR web.lokal.
langkah terakhir tambahkan
domain web.lokal nameserver 192.168.1.3
di /etc/resolv.conf, letakkan pada bagian paling atas. restart bind
service named restart
bila tidak ada error hasil eksekusi perintah /bin/systemctl status named.service kurang lebih seperti dibawah ini
named.service - Berkeley Internet Name Domain (DNS) Loaded: loaded (/usr/lib/systemd/system/named.service; disabled) Active: active (running) since Tue, 18 Sep 2012 00:32:02 +0700; 3min 8s ago Process: 7180 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS) Process: 7191 ExecStart=/usr/sbin/named -u named $OPTIONS (code=exited, status=0/SUCCESS) Process: 7188 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=0/SUCCESS) Main PID: 7192 (named) CGroup: name=systemd:/system/named.service └ 7192 /usr/sbin/named -u named Sep 18 00:32:02 jaranguda named[7192]: zone web.lokal/IN: loaded serial 2012071101 Sep 18 00:32:02 jaranguda named[7192]: zone localhost.localdomain/IN: loaded serial 0 Sep 18 00:32:02 jaranguda named[7192]: zone localhost/IN: loaded serial 0 Sep 18 00:32:02 jaranguda named[7192]: zone 192.168.1.in-addr.arpa/IN: loaded serial 2012071101 Sep 18 00:32:02 jaranguda named[7192]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0 Sep 18 00:32:02 jaranguda named[7192]: zone 0.in-addr.arpa/IN: loaded serial 0 Sep 18 00:32:02 jaranguda named[7192]: all zones loaded Sep 18 00:32:02 jaranguda named[7192]: running Sep 18 00:32:02 jaranguda named[7192]: zone web.lokal/IN: sending notifies (serial 2012071101) Sep 18 00:32:02 jaranguda named[7192]: zone 192.168.1.in-addr.arpa/IN: sending notifies (serial 2012071101)
untuk melihat hasilnya gunakan perintah dig a web.lokal @localhost hasil eksekusi perintah diatas kira-kira
; <<>> DiG 9.9.1-P2-RedHat-9.9.1-5.P2.fc17 <<>> a web.lokal @localhost ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39090 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;web.lokal. IN A ;; ANSWER SECTION: web.lokal. 86400 IN A 192.168.1.3 ;; AUTHORITY SECTION: web.lokal. 86400 IN NS ns1.web.lokal. ;; ADDITIONAL SECTION: ns1.web.lokal. 86400 IN A 192.168.1.3 ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Tue Sep 18 00:37:31 2012 ;; MSG SIZE rcvd: 87
coba ping ke IP 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data. 64 bytes from 192.168.1.3: icmp_req=1 ttl=64 time=0.061 ms 64 bytes from 192.168.1.3: icmp_req=2 ttl=64 time=0.105 ms 64 bytes from 192.168.1.3: icmp_req=3 ttl=64 time=0.094 ms 64 bytes from 192.168.1.3: icmp_req=4 ttl=64 time=0.085 ms 64 bytes from 192.168.1.3: icmp_req=5 ttl=64 time=0.095 ms 64 bytes from 192.168.1.3: icmp_req=6 ttl=64 time=0.089 ms --- 192.168.1.3 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 4999ms rtt min/avg/max/mdev = 0.061/0.088/0.105/0.014 ms
berhasil, sekarang coba ping ke alamat domain yang baru dibuat
PING web.lokal (192.168.1.3) 56(84) bytes of data. 64 bytes from web.lokal (192.168.1.3): icmp_req=1 ttl=64 time=0.061 ms 64 bytes from web.lokal (192.168.1.3): icmp_req=2 ttl=64 time=0.070 ms 64 bytes from web.lokal (192.168.1.3): icmp_req=3 ttl=64 time=0.161 ms 64 bytes from web.lokal (192.168.1.3): icmp_req=4 ttl=64 time=0.071 ms 64 bytes from web.lokal (192.168.1.3): icmp_req=5 ttl=64 time=0.131 ms 64 bytes from web.lokal (192.168.1.3): icmp_req=6 ttl=64 time=0.091 ms
berhasil juga, berarti konfigurasi DNS Server di Fedora 17 telah berhasil :) kedua cara ini bisa berjalandi 32 bit dan 64 bit.