IP Server 192.168.11.11
Example name server ns1.irdhy.com
Langsung aja boss
1.Install Bind
- yum install bind
2.Masuk ke direktori named.conf karena konfigurasi akan tersimpan disini
- vi /etc/named.conf
- Ubah Line 11
listen-on port 53 { 127.0.0.1; }; menjadi listen-on port 53 { 192.168.11.11; };
- Ubah Line 17
allow-query { localhost; }; menjadi allow-query { 192.168.11.0/24; };
Note :
- Listen port 53 Adalah IP Address DNS Server yg digunakan
- Allow Query Adalah Client yg Dapat mengakses DNS Server tsb / Networks yg bisa Akses DNS tsb.
3.Tambahkan zone untuk ns1.irdhy.com sbb :
# FORWARD ZONE ( HOSTNAME TO IP ADDRESS )
zone "irdhy.com" IN {
type master;
file "/var/named/forward.zone";
allow-update { none; };
};
# REVERSE ZONE ( IP ADDRESS TO HOSTNAME )
zone "11.168.192.in-addr.arpa" IN {
type master;
file "/var/named/reverse.zone";
allow-update { none; };
};
4.Buat File Forward Zone ( Untuk Hostname )
- vi /var/named/forward.zone
5.Config file Forward Zone sbb :
$ORIGIN irdhy.com.
$TTL 86400
@ IN SOA ns1.irdhy.com. hostmaster.irdhy.com. (
2001062501 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
;
;
IN NS ns1.irdhy.com.
ns1 IN A 192.168.11.11
;
;
@ IN MX 10 mail.irdhy.com.
mail IN A 192.168.11.11
;
;
; This sample zone file illustrates sharing the same IP addresses
; for multiple services:
;
services IN A 192.168.11.11
ftp IN CNAME services.irdhy.com.
www IN CNAME services.irdhy.com.
6.Buat File Reverse Zone ( Untuk IP Address )
- vi /var/named/reverse.zone
7.Config File Reverse Zone sbb :
$ORIGIN 11.168.192.in-addr.arpa.
$TTL 86400
@ IN SOA ns1.irdhy.com. hostmaster.irdhy.com. (
2001062501 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
;
@ IN NS ns1.irdhy.com.
11 IN PTR ns1.irdhy.com.
11 IN PTR ftp.irdhy.com.
10. Restart Bind
- /etc/init.d/named restart
- service named start
11. Agar Config yg kita buat langsung berjalan ( Autorun )
- chkconfig named on
12. Disable Firewall
- service iptables save
- service iptables stop
- chkconfig iptables off
13. Disable SELinux
- vi /etc/selinux/config
Ubah SELINUX=enforcing menjadi SELINUX=disabled
14. Reboot
Selesai
Ini Hasil nya boss...
Di Linux Fedora 14
[root@fedora irdhy]# dig -x 192.168.11.11
; <<>> DiG 9.7.4b1-RedHat-9.7.4-0.2.b1.fc14 <<>> -x 192.168.11.11
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45158
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;11.11.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
11.11.168.192.in-addr.arpa. 86400 IN PTR ns1.irdhy.com.
;; AUTHORITY SECTION:
11.168.192.in-addr.arpa. 86400 IN NS ns1.irdhy.com.
;; ADDITIONAL SECTION:
ns1.irdhy.com. 86400 IN A 192.168.11.11
;; Query time: 0 msec
;; SERVER: 192.168.11.11#53(192.168.11.11)
;; WHEN: Sat Jun 18 02:08:39 2011
;; MSG SIZE rcvd: 101
[root@fedora irdhy]# dig www.irdhy.com
; <<>> DiG 9.7.4b1-RedHat-9.7.4-0.2.b1.fc14 <<>> www.irdhy.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17076
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;www.irdhy.com. IN A
;; ANSWER SECTION:
www.irdhy.com. 86400 IN CNAME irdhy.com.
;; AUTHORITY SECTION:
irdhy.com. 86400 IN SOA ns1.irdhy.com. hostmaster.irdhy.com. 2001062501 21600 3600 604800 86400
;; Query time: 0 msec
;; SERVER: 192.168.11.11#53(192.168.11.11)
;; WHEN: Sat Jun 18 02:10:19 2011
;; MSG SIZE rcvd: 96
[root@fedora irdhy]# nslookup www.yahoo.com
Server: 192.168.11.11
Address: 192.168.11.11#53
Non-authoritative answer:
www.yahoo.com canonical name = fpfd.wa1.b.yahoo.com.
fpfd.wa1.b.yahoo.com canonical name = fp.wg1.b.yahoo.com.
fp.wg1.b.yahoo.com canonical name = any-fp.wa1.b.yahoo.com.
Name: any-fp.wa1.b.yahoo.com
Address: 98.137.149.56
Name: any-fp.wa1.b.yahoo.com
Address: 72.30.2.43
Selamat mencoba
Note :
- IP Address untuk DNS Server harus menggunakan IP Statik
- Ganti 11.168.192 tiga oktet pertama jaringan yang anda gunakan
- Juga file zona /var/named/reverse.zone harus tepat. Hal ini juga harus disesuaikan dengan oktet pertama jaringan anda.
- MX digunakan untuk Mail Server
- Saya membuat hanya 1 Dns saja ( Primary Master ) untuk slave ( Secondary Master ) nya bisa lihat
Terima kasih.
Referensi
Fedora-14-Manual-Guide
Thank's