root@centos:# yum install bind bind-utilsKonfigurasi Named
Setelah terinstall, edit file /etc/named.conf
root@centos:# vi /etc/named.confKemudian konfigurasinya seperti contoh :
Menambah Zone DNS//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion no;# dnssec-enable yes;
# dnssec-validation yes;
# dnssec-lookaside auto;/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";managed-keys-directory "/var/named/dynamic";
};logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};zone "." IN {
type hint;
file "named.ca";
};zone "namadomain.com" IN {
type master;
file "db.namadomain.com";
};#include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
Sebagai contoh menambah DNS record untuk domain namadomain.com
root@centos:# vi /var/named/db.namadomain.comKemudian DNS Zone seperti contoh ini:
Perlu diketahui, jika kita membuat zone record yg lain, pastikan serial numbernya harus berbeda dengan yg lain.; Zone file for namadomain.com
$TTL 86400
@ 86400 IN SOA ns1.namadomain.com. hostmaster.namadomain.com. (
2014011401 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, secondsnamadomain.com. 86400 IN NS ns1.namadomain.com.
namadomain.com. 86400 IN NS ns2.namadomain.com.ns1.namadomain.com. IN A 192.168.1.100
ns2.namadomain.com. IN A 192.168.2.100namadomain.com. IN A 192.168.3.100
localhost.namadomain.com. IN A 127.0.0.1
namadomain.com. IN MX 0 namadomain.com.
mail IN CNAME namadomain.com.
www IN CNAME namadomain.com.
ftp IN A 192.168.3.100
Mengaktifkan Service Named dan Autostart
Setelah selesai setup DNS, maka perlu diaktifkan dan otomatis aktif saat server boot
Jika menambah record DNS baru, bind harus direloadroot@centos:# service named start
root@centos:# chkconfig named on
root@centos:# service named reload