Setting DNS Server pada Ubuntu Server

hasil kopi paste dari
http://numb.web.id/ubuntu-server/setting-dns-server-pada-ubuntu-server.html untuk memebuat DNS local
1. Langkah pertama konfigurasi adalah mengedit file /etc/bind/named.conf.options untuk menambahkan DNS Forward, disini saya gunakan DNS public dari google saja.
root@smasa:~# nano /etc/bind/named.conf.options
options {
directory “/var/cache/bind”;
// 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 {
8.8.8.8;
8.8.4.4;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
2. Lanjutkan dengan mengedit file /etc/bind/named.conf.local untuk menentukan zona DNS Record Local, saat mengedit sesuaikan zona yang akan dipakai sesuai kebutuhan atau kepentingan anda
root@smasa:~# nano /etc/bind/named.conf.local
//
// 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 “smasabws.com” {
type master;
file “/etc/bind/db.smasabws.com”;
};
zone “0.168.192.in-addr.arpa” {
type master;
file “/etc/bind/db.192″;
};
include “/etc/bind/rndc.key”;
3. Dilanjutkan dengan menduplicate file db local sesuai dengan nama file yang disebutkan di /etc/bind/named.conf.local dengan mengetikkan perintah sebagai berikut :
root@smasa:~# cp /etc/bind/db.local /etc/bind/db.smasabws.com
root@smasa:~# cp /etc/bind/db.local /etc/bind/db.192
4. Setelah di duplikat, saya lanjutkan dengan mengedit file /etc/bind/db.smasabws.com
root@smasa:~# nano /etc/bind/db.smasabws.com
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.smasabws.com. mail.smasabws.com. (
20100820 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
localhost IN A 127.0.0.1
@ IN NS ns.smasabws.com.
ns IN A 192.168.0.1
smtp IN CNAME ns
www IN CNAME ns
cups IN CNAME ns
proxy IN CNAME ns
smasabws IN A 192.168.0.1
5. Dilanjutkan dengan mengedit file /etc/bind/db.192
root@smasa:~# nano /etc/bind/db.192
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.smasabws.com. mail.smasabws.com (
20100820 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
1 IN PTR ns.smasabws.com.
www IN CNAME ns
smtp IN CNAME ns
cups IN CNAME ns
proxy IN CNAME ns
6. Setelah konfigurasi selesai lanjutkan dengan mengedit file /etc/hosts untuk mengaktifkan beberapa domain yang ingin diaktifkan sebagai host
root@smasa:~# nano /etc/hosts
127.0.0.1 localhost
192.168.0.1 smasa smasabws.com smtp.smasabws.com proxy.smasabws.com
7. Setelah itu edit file /etc/resolv.conf
root@smasa:~# nano /etc/resolv.conf
search smasabws.com
nameserver 192.168.0.1
nameserver 127.0.0.1
8. Terakhir restart networking dan bind9
root@smasa:~# /etc/init.d/networking restart
root@smasa:~# /etc/init.d/bind9 restart
9. Install dnsutils untuk menguji bind9 dengan perintah sebagai berikut
apt-get install dnsutils
10. Lakukan checkzone untuk mengetest hasil konfigurasi kita pada file /etc/bind/db.smasabws.com dan /etc/bind/db.192
root@smasa:~# named-checkzone smasabws.com /etc/bind/db.smasabws.com
zone smasabws.com/IN: loaded serial 20100820
OK
root@smasa:~# named-checkzone smasabws.com /etc/bind/db.192
zone smasabws.com/IN: loaded serial 20100820
OK
11. Lanjutkan dengan mengecek dengan menggunakan perintah dig, dimulai dari localhost
root@smasa:~# dig localhost
; <> DiG 9.6.1-P2 <> localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- 31417="31417" br="br" id:="id:" noerror="noerror" opcode:="opcode:" query="query" status:="status:"> ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;localhost. IN A
;; ANSWER SECTION:
localhost. 604800 IN A 127.0.0.1
;; AUTHORITY SECTION:
localhost. 604800 IN NS localhost.
;; ADDITIONAL SECTION:
localhost. 604800 IN AAAA ::1
;; Query time: 0 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Fri Aug 20 08:25:26 2010
;; MSG SIZE rcvd: 85
12. Cek juga sambungan ke internet
root@smasa:~# dig yahoo.com
; <> DiG 9.6.1-P2 <> yahoo.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER< set type=any
> smasabws.com
Server: 192.168.0.1
Address: 192.168.0.1#53
smasabws.com nameserver = ns.smasabws.com.
smasabws.com
origin = ns.smasabws.com
mail addr = mail.smasabws.com
serial = 20100820
refresh = 604800
retry = 86400
expire = 2419200
minimum = 604800
Selamat mencobaĆ¢€¦

Tidak ada komentar:

Posting Komentar