• bind 小测试


    #测试其他功能临时搭建测试

    主配置文件:

    [root@localhost named]# cat /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.
    //
    // See the BIND Administrator's Reference Manual (ARM) for details about the
    // configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
    
    options {
        listen-on port 53 { 127.0.0.1;
                    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";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-query     { localhost;
                any;
                 };
    
        /* 
         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
         - If you are building a RECURSIVE (caching) DNS server, you need to enable 
           recursion. 
         - If your recursive DNS server has a public IP address, you MUST enable access 
           control to limit queries to your legitimate users. Failing to do so will
           cause your server to become part of large scale DNS amplification 
           attacks. Implementing BCP38 within your network would greatly
           reduce such attack surface 
        */
        recursion yes;
    
        dnssec-enable no;
        dnssec-validation no;
    
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
    
        managed-keys-directory "/var/named/dynamic";
    
        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
    };
    
    logging {
            channel default_debug {
                    file "data/named.run";
                    severity dynamic;
            };
    };
    
    zone "." IN {
        type hint;
        file "named.ca";
    };
    
    zone "sgcc.com.cn" IN {
                    type master;
                    file "sgcc.com.cn.zone";
                     };
    include "/etc/named.rfc1912.zones";
    include "/etc/named.root.key";
    
    [root@localhost named]# 

    zone 配置文件:

    [root@localhost named]# cat /var/named/sgcc.com.cn.zone
    $TTL 3600
    $ORIGIN  sgcc.com.cn.
    @    IN     SOA  ns.sgcc.com.cn. admin.sgcc.com.cn (
                20171024
                1H
                5M
                1D
                1D            )
            IN     NS   ns.sgcc.com.cn.
    test    IN     A    192.168.100.100
    test    IN     A    192.168.100.103  
    www2    IN    A    192.168.100.103
    ns      IN     A    192.168.100.101
    
    [root@localhost named]# 

    dig :

    安装  dig 工具:

         yum install bind-utils -y

    [root@localhost named]# dig -t A @192.168.100.101 test.sgcc.com.cn
    
    ; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> -t A @192.168.100.101 test.sgcc.com.cn
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62760
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 2
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;test.sgcc.com.cn.        IN    A
    
    ;; ANSWER SECTION:
    test.sgcc.com.cn.    3600    IN    A    192.168.100.100
    test.sgcc.com.cn.    3600    IN    A    192.168.100.103
    
    ;; AUTHORITY SECTION:
    sgcc.com.cn.        3600    IN    NS    ns.sgcc.com.cn.
    
    ;; ADDITIONAL SECTION:
    ns.sgcc.com.cn.        3600    IN    A    192.168.100.101
    
    ;; Query time: 1 msec
    ;; SERVER: 192.168.100.101#53(192.168.100.101)
    ;; WHEN: Sun Mar 10 21:19:02 EDT 2019
    ;; MSG SIZE  rcvd: 110
    
    [root@localhost named]# 
  • 相关阅读:
    【转】StackExchange.Redis 事务控制和Batch批量操作
    mysql 修改时子查询的问题
    mysql 对于有null值的 NOT IN和NOT EXISTS
    【转】Core使用Redis做Session进程外储存
    Filter的注入方式 NET Core
    MiddleWare中间键实现 简单的防盗链 AOP
    c# Jenkins+PowerShell持续集成环境搭建
    VS2019下载离线安装包
    1226 六晴
    1225 五 晴
  • 原文地址:https://www.cnblogs.com/zy09/p/10512308.html
Copyright © 2020-2023  润新知