IGOS Nusantara dan DNS dengan BIND: Perbedaan revisi
(→/var/named/chroot/etc/named.conf) |
|||
Baris 22: | Baris 22: | ||
Nama FTP Server: ftp.domainku-lokal.com | Nama FTP Server: ftp.domainku-lokal.com | ||
− | === /var/named/chroot/etc/named.conf === | + | === Berkas: /var/named/chroot/etc/named.conf === |
+ | |||
options { | options { | ||
listen-on port 53 { 127.0.0.1; }; | listen-on port 53 { 127.0.0.1; }; | ||
Baris 40: | Baris 41: | ||
}; | }; | ||
}; | }; | ||
− | + | ||
− | zone "." IN { | + | zone "." IN { |
type hint; | type hint; | ||
− | file "named.ca"; | + | file "named.ca"; |
}; | }; | ||
include "/etc/named.rfc1912.zones"; | include "/etc/named.rfc1912.zones"; | ||
− | + | ||
// ------------- | // ------------- | ||
// Resolve DNS | // Resolve DNS | ||
// ------------- | // ------------- | ||
− | zone " | + | zone "domainku-lokal.com" IN { |
type master; | type master; | ||
− | file "./zone/ | + | file "./zone/domainku-lokal.com.zone"; |
allow-update { key "rndckey"; }; | allow-update { key "rndckey"; }; | ||
allow-transfer { 192.168.0/26; }; | allow-transfer { 192.168.0/26; }; | ||
Baris 67: | Baris 68: | ||
allow-transfer { 192.168.0/26; }; | allow-transfer { 192.168.0/26; }; | ||
}; | }; | ||
− | + | ||
include "/etc/named.primary.conf"; | include "/etc/named.primary.conf"; | ||
+ | |||
+ | === Berkas: /var/named/chroot/var/named/zone/domainku-lokal.com.zone === | ||
+ | |||
+ | $ttl 38400 | ||
+ | @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( | ||
+ | 1196006770 | ||
+ | 10800 | ||
+ | 3600 | ||
+ | 604800 | ||
+ | 38400 ) | ||
+ | IN NS pc3.domainku-lokal.com. | ||
+ | IN MX 20 mail.domainku-lokal.com. | ||
+ | fx IN A 192.168.0.3 | ||
+ | www IN CNAME pc3 | ||
+ | ftp IN CNAME pc3 | ||
+ | |||
+ | === Berkas: /var/named/chroot/var/named/zone/0.168.192.in-addr.arpa.zone === | ||
+ | |||
+ | $ttl 38400 | ||
+ | @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( | ||
+ | 1196006769 | ||
+ | 10800 | ||
+ | 3600 | ||
+ | 604800 | ||
+ | 38400 ) | ||
+ | IN NS pc3.domainku-lokal.com. | ||
+ | 44 IN PTR pc3.domainku-lokal.com. | ||
+ | |||
+ | === Berkas: /var/named/chroot/etc/named.primary.conf === | ||
+ | |||
+ | // ---------------------------- | ||
+ | // Virtual Domain latihan-lokal.com | ||
+ | // ---------------------------- | ||
+ | zone "latihan-lokal.com" IN { | ||
+ | type master; | ||
+ | file "./zone/latihan-lokal.com.zone"; | ||
+ | allow-update { key "rndckey"; }; | ||
+ | allow-transfer { 192.168.0/26; }; | ||
+ | }; | ||
+ | |||
+ | // ---------------------------- | ||
+ | // Virtual Domain percobaanku.com | ||
+ | // ---------------------------- | ||
+ | zone "percobaanku.com" IN { | ||
+ | type master; | ||
+ | file "./zone/percobaanku.com.zone"; | ||
+ | allow-update { key "rndckey"; }; | ||
+ | allow-transfer { 192.168.0/26; }; | ||
+ | }; | ||
+ | |||
+ | === Berkas: /var/named/chroot/var/named/zone/latihan-lokal.com.zone === | ||
+ | |||
+ | $ttl 38400 | ||
+ | @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( | ||
+ | 1196006770 | ||
+ | 10800 | ||
+ | 3600 | ||
+ | 604800 | ||
+ | 38400 ) | ||
+ | IN NS pc3.latihan-lokal.com. | ||
+ | IN MX 20 mail.latihan-lokal.com. | ||
+ | pc3 IN A 192.168.0.40 | ||
+ | www IN CNAME pc3 | ||
+ | ftp IN CNAME pc3 | ||
+ | |||
+ | === /var/named/chroot/var/named/zone/percobaanku.com.zone === | ||
+ | |||
+ | $ttl 38400 | ||
+ | @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( | ||
+ | 1196006770 | ||
+ | 10800 | ||
+ | 3600 | ||
+ | 604800 | ||
+ | 38400 ) | ||
+ | IN NS pc3.percobaanku.com. | ||
+ | IN MX 20 mail.percobaanku.com. | ||
+ | pc3 IN A 192.168.0.40 | ||
+ | www IN CNAME pc3 | ||
+ | ftp IN CNAME pc3 | ||
+ | |||
+ | === /etc/resolv.conf === | ||
+ | search domainku-lokal.com | ||
+ | search latihan-lokal.com | ||
+ | search percobaanku.com | ||
+ | nameserver 127.0.0.1 | ||
+ | nameserver 192.168.0.40 | ||
+ | |||
+ | === Tes konfigurasi DNS server === | ||
+ | $ dig domainku-lokal.com | ||
+ | $ nslookup www.domainku-lokal.com | ||
+ | |||
+ | === Jalankan daemon DNS server === | ||
+ | Pasang untuk runlevel yang diinginkan: | ||
+ | # /sbin/chkconfig --levels 235 named on | ||
== Kasus2: DNS server untuk domainku-luar.com == | == Kasus2: DNS server untuk domainku-luar.com == |
Revisi per 27 Agustus 2011 08.04
Lihat skema jaringan, DNS server dipasang di server dengan IP 192.168.0.1
Daftar isi
- 1 Pasang
- 2 Konfigurasi BIND
- 3 Kasus1: DNS server untuk domainku-lokal.com
- 3.1 Berkas: /var/named/chroot/etc/named.conf
- 3.2 Berkas: /var/named/chroot/var/named/zone/domainku-lokal.com.zone
- 3.3 Berkas: /var/named/chroot/var/named/zone/0.168.192.in-addr.arpa.zone
- 3.4 Berkas: /var/named/chroot/etc/named.primary.conf
- 3.5 Berkas: /var/named/chroot/var/named/zone/latihan-lokal.com.zone
- 3.6 /var/named/chroot/var/named/zone/percobaanku.com.zone
- 3.7 /etc/resolv.conf
- 3.8 Tes konfigurasi DNS server
- 3.9 Jalankan daemon DNS server
- 4 Kasus2: DNS server untuk domainku-luar.com
- 5 Kasus3: DNS server untuk resolver
- 6 chkconfig
- 7 Jalankan
- 8 Konfigurasi client
Pasang
yum install bind-chroot
Konfigurasi BIND
File-file yang harus diperhatikan untuk mengkonfigurasikan BIND, antara lain:
- /etc/resolv.conf: (berisi alamat domain atau alamat IP dari name server).
- /etc/named.conf (berisi keterangan letak dan jenis database yang dibutuhkan oleh BIND).
- /var/named/named.ca: (berisi informasi data yang berada dalam domain root, yang akan dipergunakan name server
jika ada resolver yang akan meminta nama domain diluar nama domain lokal).
- /var/named/named.local: (berisi alamat loopback untuk alamat ke diri sendiri dengan alamat 127.0.0.1).
Kasus1: DNS server untuk domainku-lokal.com
Dalam studi kasus kali ini akan membuat domain baru untuk DNS Server dan mail server, ftp server, http server, dengan data sebagai berikut: Nama Domain: domainku-lokal.com Nama DNS Server: ns.domainku-lokal.com
IP DNS Server: 192.168.0.1 Nama Mail Server: mail.domainku-lokal.com Nama HTTP Server: www.domainku-lokal.com Nama FTP Server: ftp.domainku-lokal.com
Berkas: /var/named/chroot/etc/named.conf
options { listen-on port 53 { 127.0.0.1; }; listen-on-v6 port 53 { ::1; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; memstatistics-file "/var/named/data/named_mem_stats.txt"; allow-query { localhost; }; recursion yes; }; logging { channel default_debug { file "data/named.run"; severity dynamic; }; }; zone "." IN { type hint; file "named.ca"; }; include "/etc/named.rfc1912.zones"; // ------------- // Resolve DNS // ------------- zone "domainku-lokal.com" IN { type master; file "./zone/domainku-lokal.com.zone"; allow-update { key "rndckey"; }; allow-transfer { 192.168.0/26; }; }; // ------------- // Reverse DNS // ------------- zone "0.168.192.in-addr.arpa" IN { type master; file "./zone/0.168.192.in-addr.arpa.zone"; allow-update { key "rndckey"; }; allow-transfer { 192.168.0/26; }; }; include "/etc/named.primary.conf";
Berkas: /var/named/chroot/var/named/zone/domainku-lokal.com.zone
$ttl 38400 @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( 1196006770 10800 3600 604800 38400 ) IN NS pc3.domainku-lokal.com. IN MX 20 mail.domainku-lokal.com. fx IN A 192.168.0.3 www IN CNAME pc3 ftp IN CNAME pc3
Berkas: /var/named/chroot/var/named/zone/0.168.192.in-addr.arpa.zone
$ttl 38400 @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( 1196006769 10800 3600 604800 38400 ) IN NS pc3.domainku-lokal.com. 44 IN PTR pc3.domainku-lokal.com.
Berkas: /var/named/chroot/etc/named.primary.conf
// ---------------------------- // Virtual Domain latihan-lokal.com // ---------------------------- zone "latihan-lokal.com" IN { type master; file "./zone/latihan-lokal.com.zone"; allow-update { key "rndckey"; }; allow-transfer { 192.168.0/26; }; }; // ---------------------------- // Virtual Domain percobaanku.com // ---------------------------- zone "percobaanku.com" IN { type master; file "./zone/percobaanku.com.zone"; allow-update { key "rndckey"; }; allow-transfer { 192.168.0/26; }; };
Berkas: /var/named/chroot/var/named/zone/latihan-lokal.com.zone
$ttl 38400 @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( 1196006770 10800 3600 604800 38400 ) IN NS pc3.latihan-lokal.com. IN MX 20 mail.latihan-lokal.com. pc3 IN A 192.168.0.40 www IN CNAME pc3 ftp IN CNAME pc3
/var/named/chroot/var/named/zone/percobaanku.com.zone
$ttl 38400 @ IN SOA ns.domainku-lokal.com. root.domainku-lokal.com ( 1196006770 10800 3600 604800 38400 ) IN NS pc3.percobaanku.com. IN MX 20 mail.percobaanku.com. pc3 IN A 192.168.0.40 www IN CNAME pc3 ftp IN CNAME pc3
/etc/resolv.conf
search domainku-lokal.com search latihan-lokal.com search percobaanku.com nameserver 127.0.0.1 nameserver 192.168.0.40
Tes konfigurasi DNS server
$ dig domainku-lokal.com $ nslookup www.domainku-lokal.com
Jalankan daemon DNS server
Pasang untuk runlevel yang diinginkan:
# /sbin/chkconfig --levels 235 named on
Kasus2: DNS server untuk domainku-luar.com
Kasus3: DNS server untuk resolver
chkconfig
Masukkan DNS agar jalan di init 2, 3 dan 5 gunakan:
chkconfig --levels 235 named on
Jalankan
service named start
Konfigurasi client
Pengakses atau client (misal) ada di PC5. Atur agar PC5 memakai DNS server yang ada di 192.168.0.1.