DNS ( Domain Name Server )
##############################################
[root@desktop18 ~]# yum install caching-name* bind* -y
[root@desktop18 ~]# cd /var/named/chroot/etc/
[root@desktop18 ~]# cp -p named.caching-nameserver.conf named.conf
[root@desktop18 ~]# vim named.conf
#######################################################################
Configure file and add zone
#######################################################################
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver 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.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 127.0.0.1; 192.168.0.10 ; };
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";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
allow-query { localhost; any; };
allow-query-cache { localhost; any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; any; };
match-destinations { localhost; any; };
recursion yes;
zone "3.10.10.in-addr.arpa" IN {
type master;
file "rev.zone";
allow-update { none; };
};
zone "example.com" IN {
type master;
file "fwd.zone";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
};
############################################################
add Zone File in Path
############################################################
[root@desktop18 ~]# cd /var/named/chroot/var/named
[root@desktop18 ~]# cp -p named.local rev.zone
[root@desktop18 ~]# cp -p localhost.zone fwd.zone
[root@desktop18 ~]# vim rev.zone
$TTL 86400
@ IN SOA root.example.com. root.example.com. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
10 IN PTR mail1.example.com.
11 IN PTR mail2.example.com.
[root@desktop18 ~]# vim fwd.zone
$TTL 86400
@ IN SOA root.example.com. root.example.com. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
@ IN MX 5 mail1.example.com.
@ IN MX 10 mail2.example.com.
ns1 IN A 192.168.0.10
ns2 IN A 192.168.0.11
mail1 IN A 192.168.0.10
mail2 IN A 192.168.0.11
[root@desktop18 ~]# /etc/init.d/named restart
Comments
Post a Comment