• named:域名服务器部署及配置


    1、安装bind

    yum -y install bind

    2、修改/etc/named.conf

    //
    // 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 { 127.0.0.1; };
        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";
    #    query-source    port 53;    
    #    query-source-v6 port 53;
    #    allow-query     { localhost;192.168.21.45; };
    };
    logging {
            channel default_debug {
                    file "data/named.run";
                    severity dynamic;
            };
    };
    view localhost_resolver {
        match-clients        { localhost; };
        match-destinations { localhost; };
        recursion yes;
        #include "/etc/named.rfc1912.zones";
        zone "aa.com" IN {
            type master;
            file "aa.com.zone";
            allow-update { none; };
        };
        zone "bb.com" IN {
            type master;
            file "bb.com.zone";
            allow-update { none; };
            };
        zone "cc.com" IN {
            type master;
            file "cc.com.zone";
            allow-update { none; };
            };
    
    };

    3、增加zone信息

    /var/named/aa.com.zone

    $TTL    5
    @       IN SOA  @       root (
                                          1997022700 ; Serial
                                          8      ; Refresh
                                          16     ; Retry
                                          24    ; Expire
                                          36 )    ; Minimum
    ;            IN NS       @
    ;            IN NS       @
    @           IN NS       aaa.
    aaa         IN A        127.0.0.11
    www         IN A        127.0.0.11

    /var/named/bb.com.zone

    $TTL    5
    @       IN SOA  @       root (
                                          1997022700 ; Serial
                                          8      ; Refresh
                                          16     ; Retry
                                          24    ; Expire
                                          36 )    ; Minimum
    ;            IN NS       @
    ;            IN NS       @
    @           IN NS       bbb.
    bbb         IN A        127.0.0.12
    www         IN A        127.0.0.12

    /var/named/cc.com.zone

    $TTL    5
    @       IN SOA  @       root (
                                          1997022700 ; Serial
                                          8      ; Refresh
                                          16     ; Retry
                                          24    ; Expire
                                          36 )    ; Minimum
    ;            IN NS       @
    ;            IN NS       @
    @           IN NS       ccc.
    ccc         IN A        127.0.0.13
    www         IN A        127.0.0.13

    4、修改文件权限

    chown root:named /var/named/*.com.zone;

    5、重启服务

    service named restart

    验证:

    dig www.bb.com @127.0.0.1 +short
    127.0.0.12

    每天努力一点,每天学习一点。 Keep Moving...
  • 相关阅读:
    ASP.NET MVC CheckBoxFor的int to bool
    ASP.NET MVC jQuery 树插件在项目中使用方法(一)
    ASP.NET MVC Select无限级分类选择下拉框
    ASP.NET MVC 处理404与500错误页面的方法
    使用Angularjs开发Web App 视频课程 --麦子学院课程
    NEVER QUIT. NEVER SAY NEVER.
    夏天那么短,思念却很长
    不要瞧不起别人的生活,他人也在用你看不见的方式努力
    Windows 10 安装 到SSD硬盘
    12.23daily_scrum
  • 原文地址:https://www.cnblogs.com/channy14/p/10997499.html
Copyright © 2020-2023  润新知