zoukankan      html  css  js  c++  java
  • CentOS 5.4 安装 DNS

    (一)安装 bind 及相关包

    # yum install bind bind-utils bind-libs bind-chroot

    # yum -y install caching-nameserver

     

    (二)配置

    # vi named.caching-nameserver.conf

    //
    // 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 { 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";

            
    // Those options should be used carefully because they disable port
            
    // randomization
            
    // query-source    port 53;
            
    // query-source-v6 port 53;

            allow-query     { 
    any; };
            allow-query-
    cache { any; };
    }
    ;
    logging {
            channel default_debug {
                    file 
    "data/named.run";
                    severity dynamic
    ;
            }
    ;
    }
    ;
    view localhost_resolver {
            match-clients      { 
    any; };
            match-destinations { 
    any; };
            recursion yes
    ;
            include 
    "/etc/named.rfc1912.zones";
    }
    ;

     # vi named.rfc1912.zones

    // named.rfc1912.zones:
    //
    // Provided by Red Hat caching-nameserver package 
    //
    // ISC BIND named zone configuration for zones recommended by
    // RFC 1912 section 4.1 : localhost TLDs and address zones
    // 
    // See /usr/share/doc/bind*/sample/ for example named configuration files.
    //
    zone 
    "." IN {
            
    type hint;
            file 
    "named.ca";
    }
    ;

    zone 
    "localdomain" IN {
            
    type master;
            file 
    "localdomain.zone";
            allow-update { none
    ; };
    }
    ;

    zone 
    "localhost" IN {
            
    type master;
            file 
    "localhost.zone";
            allow-update { none
    ; };
    }
    ;

    zone "gview.com" IN {
            
    type master;
            file "gview.com.zone";
            allow-update { none; };
    };

    zone 
    "0.0.127.in-addr.arpa" IN {
            
    type master;
            file 
    "named.local";
            allow-update { none
    ; };
    }
    ;

    zone 
    "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
            
    type master;
            file 
    "named.ip6.local";
            allow-update { none
    ; };
    }
    ;

    zone 
    "255.in-addr.arpa" IN {
            
    type master;
            file 
    "named.broadcast";
            allow-update { none
    ; };
    }
    ;

    zone 
    "0.in-addr.arpa" IN {
            
    type master;
            file 
    "named.zero";
            allow-update { none
    ; };
    }
    ;

    zone "1.168.192.in-addr.arpa" IN {
            
    type master;
            file "named.gview.com";
            allow-update { none; };
    };

    # vi gview.com.zone

    $TTL    86400
    @               IN SOA  ns1
    .gview.com.       admin.gview.com. (
                                            
    42              ; serial (d. adams)
                                            3H              
    ; refresh
                                            15M             
    ; retry
                                            1W              
    ; expiry
                                            1D 
    )            ; minimum

                    IN NS           ns1
    .gview.com.

                    IN A            
    192.168.1.10

    ns1             IN A            
    192.168.1.10
    it              IN CNAME        ns1
    .gview.com.
    db              IN CNAME        ns1
    .gview.com.
    ftp             IN CNAME        ns1
    .gview.com.
    svn             IN CNAME        ns1
    .gview.com.
    ldap            IN CNAME        ns1
    .gview.com.
    archiva         IN CNAME        ns1
    .gview.com.

    # vi named.gview.com

    $TTL    86400
    @       IN      SOA     ns1
    .gview.com. admin.gview.com.  (
                                          
    1997022700 ; Serial
                                          
    28800      ; Refresh
                                          
    14400      ; Retry
                                          
    3600000    ; Expire
                                          
    86400 )    ; Minimum
            IN      NS      ns1
    .gview.com.

    10      IN      PTR     ns1.gview.com.
    10      IN      PTR     it.gview.com.
    10      IN      PTR     db.gview.com.
    10      IN      PTR     ftp.gview.com.
    10      IN      PTR     svn.gview.com.
    10      IN      PTR     ldap.gview.com.
    10      IN      PTR     archiva.gview.com.
  • 相关阅读:
    最权威的 Android Oreo 新特性详解
    【送书福利】第一次送书活动(总共10本)
    【资源篇】Python那么火,你还不知道如何人门?
    不忘初心,方得始终 ,让我们一起学习成长,感谢有你!
    搭建环境篇 | 运行第一个Java Web 项目
    为什么我们需要看技术公众号文章?
    手把手教学APK反编译实现源码阅读
    分享一款 Google Pixel 2 独家动态壁纸
    了解CoordinatorLayout,在项目中运用
    jdk 与 jre的区别
  • 原文地址:https://www.cnblogs.com/kylindai/p/1708712.html
Copyright © 2011-2022 走看看