• CentOS 7 BIND 搭建


    域名查找顺序 设置 /etc/host.conf

    1. bind 安装

    $ yum install bind bind-utils
    nslookup (name server lookup) 在bind-utils 中

    查看安装结果
    $rpm -aq | grep bind
    bind-license-9.9.4-29.el7_2.3.noarch
    bind-utils-9.9.4-29.el7_2.3.x86_64
    bind-libs-lite-9.9.4-29.el7_2.3.x86_64
    bind-libs-9.9.4-29.el7_2.3.x86_64
    bind-9.9.4-29.el7_2.3.x86_64

    搭建域名 bodani.com

    2.配置主DNS服务器:
    ------------------------------------------------------------------------------------------------------------

    2.1. 主要配置文件:

    /etc/named.conf 主要配置入口

    /etc/named.rfc1912.zones 定义正反解区域相关

    /var/named/ 正反解数据库

    配置 named.conf

    // listen-onport 53 { 127.0.0.1; }; (默认监听53 端口)
    // listen-on-v6port 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";
    allow-query { any; }; (允许访问配置,默认localhost 只本机可用)

    include"/etc/named.rfc1912.zones";
    include"/etc/named.bodani.com.zones";

    配置 zones
    $cp/etc/named.rfc1912.zones /etc/named.bodani.com.zones

    $vim /etc/named.bodani.com.zones

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

    配置域名IP named.bodani.com

    默认查找文件位置为 named.conf 中 directory变量指定位置
    $cp /var/named/named.localhost /var/named/named.bodani.com

    $vim /var/named/named.bodani.com

    $TTL 1D
    @ IN SOA @ rname.invalid. (
    0 ; serial
    1D ; refresh
    1H ; retry
    1W ; expire
    3H ) ; minimum
    NS @
    A 127.0.0.1
    AAAA ::1

    node IN A 10.2.0.10
    node IN A 10.2.0.11
    node IN A 10.2.0.12
    node IN A 10.2.0.13
    node IN A 10.2.0.14
    node IN A 10.2.0.15

    3 启动named

    检验配置

    $ named-checkconf

    启动服务

    $service named start
    $service named status

    4 测试

    $ ss -tuln | grep 53

    vim /etc/resove.conf (指定域名服务器)

    nameserver 127.0.0.1

    $ nslookup node.bodani.com 127.0.0.1
    Server: 127.0.0.1
    Address: 127.0.0.1#53

    Name: node.bodani.com
    Address: 10.2.0.13
    Name: node.bodani.com
    Address: 10.2.0.11
    Name: node.bodani.com
    Address: 10.2.0.12
    Name: node.bodani.com
    Address: 10.2.0.15
    Name: node.bodani.com
    Address: 10.2.0.14
    Name: node.bodani.com
    Address: 10.2.0.10

  • 相关阅读:
    Good Bye 2014 B. New Year Permutation(floyd )
    hdu 5147 Sequence II (树状数组 求逆序数)
    POJ 1696 Space Ant (极角排序)
    POJ 2398 Toy Storage (叉积判断点和线段的关系)
    hdu 2897 邂逅明下 (简单巴什博弈)
    poj 1410 Intersection (判断线段与矩形相交 判线段相交)
    HDU 3400 Line belt (三分嵌套)
    Codeforces Round #279 (Div. 2) C. Hacking Cypher (大数取余)
    Codeforces Round #179 (Div. 2) B. Yaroslav and Two Strings (容斥原理)
    hdu 1576 A/B (求逆元)
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/5650189.html
Copyright © 2020-2023  润新知