DNS Server Linux Ubutu / Debian
Install paket bind9 dengan mengetikan perintah
root@serv-hosting:/# apt-get install bind9
root@serv-hosting:/# ifconfig
root@serv-hosting:/# nano /etc/network/interfaces
Untuk settingan IP Address, sesuaikan dengan kondisi jaringan anda. Misalkan disini menggunakan IP Public 202.162.200.99
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 202.162.200.99
netmask 255.255.255.192
gateway 202.162.200.126
Simpan perubahan dengan menekan tombol Ctrl+O dan Ctrl+x
kemudian ketik perintah
root@serv-hosting:/# /etc/init.d/networking restart
KONFIGURASI DNS SERVER
Disini kita akan membuat sebuah domain dengan nama smkn2-bdl.sch.id
Lalu tambahkan script seperti dibawah ini pada file named.conf.local yang berada di /etc/bind/named.conf.local, tulis pada bagian bawah script.
root@serv-hosting:/# nano /etc/bind/named.conf.local
zone "smkn2-bdl.sch.id" IN {
type master;
file "/etc/bind/db.smkn2-bdl.sch.id";
};
zone "200.162.202.in-addr.arpa" IN {
type master;
file "/etc/bind/db.200";
};
Jangan sampai ada huruf yang kurang, karena akan membuat dns tidak bisa running (kurangnya tanda titik (.) sangat berpengaruh sekali dengan konfigurasi DNS).
Buat file untuk zona.
root@serv-hosting:/# touch /etc/bind/db.smkn2-bdl.sch.id
root@serv-hosting:/# touch /etc/bind/db.200
root@serv-hosting:/# nano /etc/bind/db.smkn2-bdl.sch.id
$TTL 14400
@ IN SOA ns1.smkn2-bdl.sch.id. root.smkn2-bdl.sch.id. (
2009121603
14400
3600
1209600
86400 )
smkn2-bdl.sch.id. 14400 IN NS ns1.smkn2-bdl.sch.id.
smkn2-bdl.sch.id. 14400 IN NS ns2.smkn2-bdl.sch.id.
smkn2-bdl.sch.id. 14400 IN NS ns1.mas-aziz.com.
smkn2-bdl.sch.id. 14400 IN NS ns2.mas-aziz.com.
ns1 14400 IN A 202.162.200.99
ns2 14400 IN A 202.162.200.99
ftp 14400 IN A 202.162.200.99
smkn2-bdl.sch.id. 14400 IN A 202.162.200.99
localhost 14400 IN A 127.0.0.1
mail 14400 IN A 202.162.200.99
pop 14400 IN A 202.162.200.99
smtp 14400 IN A 202.162.200.99
www 14400 IN A 202.162.200.99
forum 14400 IN A 202.162.200.99
www.forum 14400 IN A 202.162.200.99
ti 14400 IN A 202.162.200.99
www.ti 14400 IN A 202.162.200.99
mas-aziz 14400 IN A 202.162.200.99
www.mas-aziz 14400 IN A 202.162.200.99
smkn2-bdl.sch.id. 14400 IN MX 10 mail
smkn2-bdl.sch.id. 14400 IN TXT "v=spf1 a mx ip4:202.162.200.99 -all"
root@serv-hosting:/# nano /etc/bind/db.200
$TTL 86400
@ IN SOA ns1.smkn2-bdl.sch.id. root.smkn2-bdl.sch.id. (
2007022701 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns1.smkn2-bdl.sch.id.
IN NS ns2.smkn2-bdl.sch.id.
1 IN PTR mas-aziz-host-200-1.smkn2.sch.id.
2 IN PTR mas-aziz-host-200-2.smkn2.sch.id.
3 IN PTR mas-aziz-host-200-3.smkn2.sch.id.
99 IN PTR serv-hosting-200-99.smkn2.sch.id.
Jalankan service named nya dengan perintah
root@serv-hosting:/# /usr/sbin/named
root@serv-hosting:/# /etc/init.d/bind9 restart
root@serv-hosting:/# tail -f /var/log/messages
root@serv-hosting:/# nano /etc/resolv.conf
nameserver 202.162.200.99
nameserver 202.162.205.237
root@serv-hosting:/# nano /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.0.1 serv-hosting.net.id serv-hosting
root@serv-hosting:/# 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 might need to uncomment the query-source
// directive below. Previous versions of BIND always asked
// questions using port 53, but BIND 8.1 and later use an unprivileged
// port by default.
// query-source address * port 53;
// 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;
// };
auth-nxdomain no; # conform to RFC1035
version "SMKN 2 Bandar Lampung";
};
Simpan dan keluar
Tes DNS dengan perintah berikut:
root@serv-hosting:/# nslookup smkn2-bdl.sch.id