DNS adalah kepanjangan dari Domain Name System. Merupakan sebuah sistem yang digunakan untuk menyimpan informasi tentang host dan domain yang terhubung di jaringan. Digunakan untuk mapping dari alamat IP agar mudah dikenali.
DNS Server merupakan server yang digunakan untuk menerjemahkan IP Address ke hostname, ataupun sebaliknya menerjemahkan hostname ke IP Address.
DNS Server di linux biasanya dijalankan oleh program yang bernama named.
Install BIND / Named di CentOS
1 2 3 |
yum install bind bind-utils /etc/init.d/named start chkconfig named on |
Konfigurasi Named
Setelah terinstall, edit file /etc/named.conf
1 |
vi /etc/named.conf |
Kemudian konfigurasinya seperti contoh:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
// // 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 { ::1; }; 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 yes; 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"; }; include "/etc/named.rfc1912.zones"; include "/etc/named.root.key"; zone "hostingdna.info" IN { type master; file "hostingdna.info"; allow-update { none; }; }; |
Menambah Zone DNS
Sebagai contoh menambah DNS record untuk domain hostingdna.info
1 |
vi /var/named/hostingdna.info |
Kemudian DNS Zone seperti contoh ini:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
; Zone file for hostingdna.info $TTL 300 hostingdna.info. 300 IN SOA ns1.hostingdna.info. master.hostingdna.info. ( 2010032506 ;Serial Number 300 ;refresh 7200 ;retry 3600000 ;expire 300 ;minimum ) hostingdna.info. 300 IN NS ns1.hostingdna.info. hostingdna.info. 300 IN NS ns2.hostingdna.info. hostingdna.info. 300 IN A 69.163.37.170 localhost 300 IN A 127.0.0.1 hostingdna.info. 300 IN MX 0 mail.hostingdna.info. mail 300 IN CNAME hostingdna.info. www 300 IN CNAME hostingdna.info. ftp 300 IN A 69.163.37.170 ns1 14400 IN A 69.163.37.170 ns2 14400 IN A 69.163.37.170 |
Perlu diketahui, jika kita membuat zone record yg lain,
Jika menambah record DNS baru, bind harus direload
1 |
service named reload |