redhat-DNS

#master DNS
cd /var/named/chroot/etc
cp named-caching.nameserver.conf  named.conf
vi named.conf
options{
     listen-on port 53 {127.0.0.1;192.168.0.0/24;};
;
;
   allow-query {localhost; 192.168.0.0/24;};
};
view localhost_resolver {
   match-clients    { localhost; 192.168.0.0/24;};
   match-destinations  { localhost; 192.168.0.0/24;};
...
zone "cracker.org" IN {
   type master;
   file "cracker.org.zone";
};
zone "1.168.192.in-addr.arpa" IN {
  type master;
  file "192.168.1.zone";
};
cd  /var/named/chroot/var/named
vi creaker.org.zone
$TTL  86400
@     IN SOA cracker.org.   root.cracker.org. (
                42   
              3H
               15M
               1W
               1D)
               IN             NS       server.cracker.org.
server       IN            A       192.168.1.1
 
vi 192.168.1.zone
$TTL  86400
@          IN         SOA cracker.org.   root.cracker.org. (
               42   
               3H
               15M
               1W
               1D)
               IN             NS    server.cracker.org.
1             IN            PTR    server.cracker.org.
chown named:named cracker.org.zone
chown named:named 192.168.1.zone
 
# if host server.craker.org not found:2(servfail) check chown
 
rndc reload
 
host server.cracker.org  /  host 192.168.1.1 to check
 
#configure DNS for example.com domain , www is 192.168.1.20 and NS is 192.168.1.30
vi example.com.zone
   @    IN          NS      192.168.1.30
www   IN        A         192.168.1.20
 
#round-robin balance for www.example.com  with 3 hosts
vi example.com.zone
www  0  IN  A  192.168.1.1
www  0  IN  A  192.168.1.2
www  0  IN  A  192.168.1.3
 
#confirgure 5 ips for www servers with robin-loading balance
configure 3 ips for mail servers with primary mail server to mail1
confiure 1 ip for NS server
vi example.com.zone
@  IN  NS  192.168.1.10
www  0  IN  A  192.168.1.1
www  0  IN  A  192.168.1.2
www  0  IN  A  192.168.1.3
www  0  IN  A  192.168.1.4
www  0  IN  A  192.168.1.5
mail 1  IN A 192.168.1.6
mail2   IN A 192.168.1.7
mail 3  IN  A 192.168.1.8
@  IN  MX 5  mail1.example.com
@  IN  MX 8  mail2.example.com
@  IN  MX 10  mail3.example.com
 
#configure slave DNS server
vi /var/named/chroot/etc/named.conf
zone "cracker.org" IN {
   type slave;
   masters {192.168.1.1;};
   file "slaves/cracker.org.zone";
};

on master DNS server
vi /var/named/chroot/etc/named.conf
options{
     listen-on port 53 {127.0.0.1;192.168.0.0/24;};
;
;
   allow-query {localhost; 192.168.0.0/24;};
   allow-transfer {192.168.1.10;};
};

vi /var/named/chroot/var/named/example.com.zone
3M refresh
3M retry

service named restart



#configure cach-only name server (named.conf)
options {
     forwarders {192.168.1.1;};
     forward only;
};

#ensure    soft link
ln -s /var/named/chroot/etc/named.conf  /etc/named.conf
port 53 enabled in firewall
 
 
    
 

你可能感兴趣的:(redhat,职场,休闲)