Konfigurasi DNS di Ubuntu 7.10 Menggunakan bind9
Akhirnya berhasil juga setting DNS di Ubuntu Gutsy, walaupun harus bolak balik warnet dikarenakan saya nggak punya repositorinya. Kebetulan server inherent masih dalam proses perbaikan, makanya nggak bisa apt-get dari repositori lokal. Repot juga kalau nggak punya repositori, harus cari file-file dependensi yang dibutuhkan. Berikut yang dapat saya dokumentasikan.
Langkah-langkah setting DNS menggunakan bind9
1. Install bind9
root@komputer16-desktop:/home/komputer16/bind9# dpkg -i bind9_9.4.1-P1-3ubuntu2_i386.deb Selecting previously deselected package bind9. (Reading database ... 89207 files and directories currently installed.) Unpacking bind9 (from bind9_9.4.1-P1-3ubuntu2_i386.deb) ... dpkg: dependency problems prevent configuration of bind9: bind9 depends on libdns32 (= 1:9.4.1-P1-3ubuntu2); however: Version of libdns32 on system is 1:9.4.1-P1-3. bind9 depends on libisccfg30 (= 1:9.4.1-P1-3ubuntu2); however: Version of libisccfg30 on system is 1:9.4.1-P1-3. bind9 depends on libisc32 (= 1:9.4.1-P1-3ubuntu2); however: Version of libisc32 on system is 1:9.4.1-P1-3. bind9 depends on libisccc30 (= 1:9.4.1-P1-3ubuntu2); however: Version of libisccc30 on system is 1:9.4.1-P1-3. dpkg: error processing bind9 (--install): dependency problems - leaving unconfigured Errors were encountered while processing: bind9
Ternyata masih memerlukan file dependensi : libdns32, libisccfg30, libisc32, libisccc30. Cari di internet, download. Pastikan file dependensi tersebut untuk Ubuntu Gutsy Gibbon. Install file dependensi tersebut.
root@komputer16-desktop:/home/komputer16/bind9# dpkg -i libdns32_9.4.1-P1-3ubuntu2_i386.deb; dpkg -i libisccfg30_9.4.1-P1-3ubuntu2_i386.deb; dpkg -i libisc32_9.4.1-P1-3ubuntu2_i386.deb; dpkg -i libisccc30_9.4.1-P1-3ubuntu2_i386.deb (Reading database ... 89247 files and directories currently installed.) Preparing to replace libdns32 1:9.4.1-P1-3 (using libdns32_9.4.1-P1-3ubuntu2_i386.deb) ... Unpacking replacement libdns32 ... Setting up libdns32 (1:9.4.1-P1-3ubuntu2) ... Processing triggers for libc6 ... ldconfig deferred processing now taking place (Reading database ... 89247 files and directories currently installed.) Preparing to replace libisccfg30 1:9.4.1-P1-3 (using libisccfg30_9.4.1-P1-3ubuntu2_i386.deb) ... Unpacking replacement libisccfg30 ... Setting up libisccfg30 (1:9.4.1-P1-3ubuntu2) ... Processing triggers for libc6 ... ldconfig deferred processing now taking place (Reading database ... 89247 files and directories currently installed.) Preparing to replace libisc32 1:9.4.1-P1-3 (using libisc32_9.4.1-P1-3ubuntu2_i386.deb) ... Unpacking replacement libisc32 ... Setting up libisc32 (1:9.4.1-P1-3ubuntu2) ... Processing triggers for libc6 ... ldconfig deferred processing now taking place (Reading database ... 89247 files and directories currently installed.) Preparing to replace libisccc30 1:9.4.1-P1-3 (using libisccc30_9.4.1-P1-3ubuntu2_i386.deb) ... Unpacking replacement libisccc30 ... Setting up libisccc30 (1:9.4.1-P1-3ubuntu2) ... Processing triggers for libc6 ... ldconfig deferred processing now taking place
Proses installasi file dependensi selesai. Coba install lagi bind9
root@komputer16-desktop:/home/komputer16/bind9# dpkg -i bind9_9.4.1-P1-3ubuntu2_i386.deb (Reading database ... 89247 files and directories currently installed.) Preparing to replace bind9 1:9.4.1-P1-3ubuntu2 (using bind9_9.4.1-P1-3ubuntu2_i386.deb) ... Unpacking replacement bind9 ... Setting up bind9 (1:9.4.1-P1-3ubuntu2) ... Adding group `bind' (GID 120) ... Done. Adding system user `bind' (UID 112) ... Adding new user `bind' (UID 112) with group `bind' ... Not creating home directory `/var/cache/bind'. wrote key file "/etc/bind/rndc.key" * Starting domain name service... bind [ OK ] bind9 sudah diinstall.
Sudah terinstall. Kalau Anda punya repositorinya, bisa langsung pakai apt-get.
root@komputer16-desktop:/home/komputer16/bind9# apt-get install bind9
2. Pastikan bind9 sudah terinstall. Coba cek. Cuma untuk memastikan.
root@komputer16-desktop:/home/komputer16/bind9# dpkg -l | grep bind9 ii bind9 1:9.4.1-P1-3ubuntu2 Internet Domain Name Server ii bind9-host 1:9.4.1-P1-3 Version of 'host' bundled with BIND 9.X ii libbind9-30 1:9.4.1-P1-3 BIND9 Shared Library used by BIND
3. Edit file /etc/resolv.conf
root@komputer16-desktop:/home/komputer16/bind9# pico /etc/resolv.conf domain enambelas.com search enambelas.com nameserver 192.168.1.16
4. Edit file /etc/bind/named.conf
root@komputer16-desktop:/home/komputer16/bind9# pico /etc/bind/named.conf // 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"; // prime the server with knowledge of the root servers zone "." { type hint; file "/etc/bind/db.root"; }; // be authoritative for the localhost forward and reverse zones, and for // broadcast zones as per RFC 1912 zone "localhost" { type master; file "/etc/bind/db.local"; }; zone "127.in-addr.arpa" { type master; file "/etc/bind/db.127"; }; zone "0.in-addr.arpa" { type master; file "/etc/bind/db.0"; }; zone "255.in-addr.arpa" { type master; file "/etc/bind/db.255"; }; //tambahkan baris berikut zone "enambelas.com" { type master; file "/etc/bind/db.enambelas.com"; }; zone "1.168.192.in-addr.arpa" { type master; file "/etc/bind/db.192.168.1"; }; // zone "com" { type delegation-only; }; // zone "net" { type delegation-only; }; // From the release notes: // Because many of our users are uncomfortable receiving undelegated answers // from root or top level domains, other than a few for whom that behaviour // has been trusted and expected for quite some length of time, we have now // introduced the "root-delegations-only" feature which applies delegation-only // logic to all top level domains, and to the root domain. An exception list // should be specified, including "MUSEUM" and "DE", and any other top level // domains from whom undelegated responses are expected and trusted. include "/etc/bind/named.conf.local";
5. Buat file /etc/bind/db.enambelas.com
root@komputer16-desktop:/home/komputer16/bind9# pico /etc/bind/db.enambelas.com $TTL 86400 @ IN SOA enambelas.com. root.enambelas.com. ( 20081122 ;Serial 604800 ;Refresh 86400 ;Retry 2419200 ;Expire 604800 ) ; Negative Cache TTL @ IN NS enambelas.com. @ IN A 192.168.1.16
6. Buat file /etc/bind/db.192.168.1
root@komputer16-desktop:/home/komputer16/bind9# pico /etc/bind/db.192.168.1 $TTL 86400 @ IN SOA enambelas.com. root.enambelas.com. ( 20081122 ;Serial 604800 ;Refresh 86400 ;Retry 2419200 ;Expire 604800) ; Negative Cache TTL ; IN NS enambelas.com. IN PTR www.enambelas.com.
7. Cek apakah settingan file db.enambelas.com sudah benar?
root@komputer16-desktop:/home# named-checkzone enambelas.com /etc/bind/db.enambelas.com zone enambelas.com/IN: loaded serial 20081122 OK
8. Cek apakah settingan file db.192.168.1 sudah benar?
root@komputer16-desktop:/home# named-checkzone 192.168.1 /etc/bind/db.192.168.1 zone 192.168.1/IN: loaded serial 20081122 OK
9. Restart service DNS
root@komputer16-desktop:/home/komputer16/bind9# /etc/init.d/bind9 restart * Stopping domain name service... bind [ OK ] * Starting domain name service... bind [ OK ]
10. Sudah selesai, sekarang tes dengan perintah dig atau ping
root@komputer16-desktop:/home/komputer16/bind9# dig enambelas.com ; <<>> DiG 9.4.1-P1 <<>> enambelas.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59585 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;enambelas.com. IN A ;; ANSWER SECTION: enambelas.com. 86400 IN A 192.168.1.16 ;; AUTHORITY SECTION: enambelas.com. 86400 IN NS enambelas.com. ;; Query time: 1 msec ;; SERVER: 192.168.1.16#53(192.168.1.16) ;; WHEN: Sat Nov 22 21:12:31 2008 ;; MSG SIZE rcvd: 61 root@komputer16-desktop:/home/komputer16/bind9# ping enambelas.com PING enambelas.com (192.168.1.16) 56(84) bytes of data. 64 bytes from komputer16-desktop.local (192.168.1.16): icmp_seq=1 ttl=64 time=0.016 ms 64 bytes from komputer16-desktop.local (192.168.1.16): icmp_seq=2 ttl=64 time=0.024 ms 64 bytes from komputer16-desktop.local (192.168.1.16): icmp_seq=3 ttl=64 time=0.025 ms 64 bytes from komputer16-desktop.local (192.168.1.16): icmp_seq=4 ttl=64 time=0.028 ms 64 bytes from komputer16-desktop.local (192.168.1.16): icmp_seq=5 ttl=64 time=0.025 ms --- enambelas.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3998ms rtt min/avg/max/mdev = 0.016/0.023/0.028/0.006 ms
Selesai sudah settingan bind9. Kalau ada yang salah mohon koreksinya.
thx
Mas, itu kan kalo cuma buat satu web (spt contoh adl enambelas.com), trus bagaimana kalo buat beberapa web (bukan subdomain) ? trims.
Terima kasih,,,,artikel2 sangat membantu saya membuat server,,,,tapi ada yang mau saya tanyakan,,,,,,,Bagaimana cara copy sript diatas di SSH connection, saya copy paste memakai Ctrl+V/ command prompt kok tidak bisa ya ???