DNS Authoritative adalah untuk memberikan informasi dari domain kedalam sebuah alamat IP.
Langkah-langkah untuk install bind pada ubuntu:
1. Install bind dan DNS utils
1 |
# sudo apt-get install bind9 dnsutils |
2. Konfigurasi named.conf
Untuk teks editor, dapat menggunakan vim atau nano.
Pada file /etc/bind/named.conf pada akhir baris konfigurasi, diberi command (#)
1 |
# vim /etc/bind/named.conf |
Sehingga isi file konfiggurasinya menjadi:
1 2 3 4 5 6 7 8 9 10 11 |
// This is the primary configuration file for the BIND DNS server named. // // Please read /usr/share/doc/bind9/README.Debian.gz for information on the // structure of BIND configuration files in Debian, *BEFORE* you customize // this configuration file. // // If you are just adding zones, please do that in /etc/bind/named.conf.local include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; #include "/etc/bind/named.conf.default-zones"; |
3. Menambah Zone records
Untuk menambah/membuat zone records, konfigurasi memakai file /etc/bind/named.conf.local
1 |
# vim /etc/bind/named.conf.local |
dan isinya seperti contoh:
1 2 3 4 5 6 7 8 9 10 11 12 |
// // Do any local configuration here // // Consider adding the 1918 zones here, if they are not used in your // organization //include "/etc/bind/zones.rfc1918"; zone "cloudmild.net" IN { type master; file "/etc/bind/db.cloudmild.net"; }; |
4. Membuat DNS records
Kemudian membuat DNS records sesuai dengan zone yang telah dibuat
1 |
# vim /etc/bind/db.cloudmild.net |
dan diisi contohnya:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
$TTL 86400 @ 86400 IN SOA ns1.cloudmild.net. hostmaster.cloudmild.net. ( 2014082001 ; serial, todays date+todays 86400 ; refresh, seconds 7200 ; retry, seconds 3600000 ; expire, seconds 86400 ) ; minimum, seconds cloudmild.net. 86400 IN NS ns1.cloudmild.net. cloudmild.net. 86400 IN NS ns2.cloudmild.net. ns1.cloudmild.net. IN A 192.168.1.100 ns2.cloudmild.net. IN A 192.168.2.100 cloudmild.net. IN A 192.168.3.100 localhost.cloudmild.net. IN A 127.0.0.1 cloudmild.net. IN MX 0 cloudmild.net. mail IN CNAME cloudmild.net. www IN CNAME cloudmild.net. ftp IN A 192.168.3.100 |
4. Konfigurasi lanjutan
Yang terakhir perlu konfigurasi named.conf.options, untuk membuat DNS Authoritative, DNS harus dapat memberikan respon kepada client yang melakukan request, dan tidak bersifat recursive, jadi konfigurasinya seperti ini:
1 |
# vim /etc/bind/named.conf.options |
Isinya seperti ini:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
options { directory "/etc/bind"; // Baris ini diubah // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. // forwarders { // 0.0.0.0; // }; //======================================================================== // If BIND logs error messages about the root key being expired, // you will need to update your keys. See https://www.isc.org/bind-keys //======================================================================== dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; allow-query { any; }; // Tambahan konfigurasi recursion no; // Tambahan konfigurasi }; |
Setelah proses konfigurasi DNS selesai, service bind perlu diaktifkan
1 |
# service bind9 start |
Kemudian test DNS yang telah dibuat;
1 |
# dig @192.168.1.100 cloudmild.net |
Jika tidak ada error, maka akan menghasilkan tampilan:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# dig @192.168.1.100 cloudmild.net ; <<>> DiG 9.9.5-3-Ubuntu <<>> @192.168.1.100 cloudmild.net ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26521 ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;cloudmild.net. IN A ;; ANSWER SECTION: cloudmild.net. 86400 IN A 192.168.3.100 ;; AUTHORITY SECTION: cloudmild.net. 86400 IN NS ns1.cloudmild.net. cloudmild.net. 86400 IN NS ns2.cloudmild.net. ;; ADDITIONAL SECTION: ns1.cloudmild.net. 86400 IN A 192.168.1.100 ns2.cloudmild.net. 86400 IN A 192.168.2.100 ;; Query time: 2 msec ;; SERVER: 192.168.1.100#53(192.168.1.100) ;; WHEN: Tue Aug 19 20:51:38 EDT 2014 ;; MSG SIZE rcvd: 126 |