February 07, 2011

Setting DNS Server pada Ubuntu Server

Setting DNS Server pada Ubuntu Server
Alhamdulillah, separuh bulan Ramadhan udah terlewati sedih juga sih tapi yang penting tetap semangat menjalani ibadah di bulan nan penuh barokah ini, yup pada kesempatan kali ini saya ingin sharing cara setting DNS Server pada Ubuntu Server menggunakan Bind9, cara seting DNS Server ini berdasarkan pada tutorial yang di buat oleh mas opick disini, dengan perubahan disesuaikan dengan kepentingan Lab. Komputer yang saya kelola dengan konfigurasi jaringan seperti disini. Jika ubuntu server anda belum terinstall paket bind9 silahkan login sebagai root kemudian ketikkan tasksel, pilih paket DNS server dengan memberikan tanda cek menggunakan spasi, kemudian tekan OK.
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 andaroot@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<<- opcode: QUERY, status: NOERROR, id: 31417
;; 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<<- opcode: QUERY, status: NOERROR, id: 60531
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 13, ADDITIONAL: 0
;; QUESTION SECTION:
;yahoo.com. IN A
;; ANSWER SECTION:
yahoo.com. 2396 IN A 72.30.2.43
yahoo.com. 2396 IN A 98.137.149.56
yahoo.com. 2396 IN A 209.191.122.70
yahoo.com. 2396 IN A 67.195.160.76
yahoo.com. 2396 IN A 69.147.125.65
;; AUTHORITY SECTION:
com. 172601 IN NS h.gtld-servers.net.
com. 172601 IN NS d.gtld-servers.net.
com. 172601 IN NS l.gtld-servers.net.
com. 172601 IN NS g.gtld-servers.net.
com. 172601 IN NS i.gtld-servers.net.
com. 172601 IN NS c.gtld-servers.net.
com. 172601 IN NS b.gtld-servers.net.
com. 172601 IN NS f.gtld-servers.net.
com. 172601 IN NS m.gtld-servers.net.
com. 172601 IN NS e.gtld-servers.net.
com. 172601 IN NS j.gtld-servers.net.
com. 172601 IN NS a.gtld-servers.net.
com. 172601 IN NS k.gtld-servers.net.
;; Query time: 62 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Fri Aug 20 08:29:00 2010
;; MSG SIZE rcvd: 331
13. Atau bisa juga menggunakan nslookup untuk menguji
root@smasa:~# nslookup
> 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…
Continue Reading...
 

. : : = di_and = ='blogs' = : : . Copyright © 2009 Girlymagz is Designed by Bie Girl Vector by Ipietoon

/>