• 构建DNS主 从服务器


    所有服务器:
    iptables -F
    systemctl stop firewalld
    setenforce 0

    配置yum


    主服务器:
    [root@localhost ~]# yum -y install bind
    [root@localhost ~]# vim /etc/resolv.conf
    # Generated by NetworkManager
    nameserver 192.168.200.111
    nameserver 192.168.200.112
    [root@localhost ~]# vim /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4
    localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6
    localhost6.localdomain6
    192.168.200.111 ns1.crushlinux.com
    192.168.200.112 ns2.crushlinux.com

    [root@localhost ~]# vim /etc/named.conf
    options {
    directory "/var/named";
    };

    zone "crushlinux.com" IN {
    type master;
    file "crushlinux.zheng";
    allow-transfer { 192.168.200.112; };
    };

    zone "200.168.192.in-addr.arpa" IN {
    type master;
    file "crushlinux.fan";
    allow-transfer { 192.168.200.112; };
    };

    [root@localhost ~]# vim /var/named/crushlinux.zheng
    $TTL 86400
    @ IN SOA crushlinux.com.
    admin.crushlinux.com. (
    20190817
    3H
    15M
    1W
    1D
    )
    IN NS ns1.crushlinux.com.
    IN NS ns2.crushlinux.com.
    IN MX 10 mail.crushlinux.com.
    ns1 IN A 192.168.200.111
    ns2 IN A 192.168.200.112
    mail IN A 192.168.200.113
    www IN A 192.168.200.114
    study IN A 192.168.200.115
    * IN A 192.168.200.111
    ftp IN CNAME www

    [root@localhost ~]# vim /var/named/crushlinux.fan
    $TTL 86400
    @ IN SOA crushlinux.com.
    admin.crushlinux.com. (
    20190817
    3H
    15M
    1W
    1D
    )
    IN NS ns1.crushlinux.com.
    IN NS ns2.crushlinux.com.
    IN MX 10 mail.crushlinux.com.
    111 IN PTR ns1.crushlinux.com.
    112 IN PTR
    ns2.crushlinux.com.
    113 IN PTR mail.crushlinux.com.
    114 IN PTR www.crushlinux.com.
    115 IN PTR study.crushlinux.com.
    111 IN PTR ns1.crushlinux.com.
    [root@localhost ~]# chown :named /var/named/crushlinux.*
    [root@localhost ~]# named-checkconf -z /etc/named.conf
    [root@localhost ~]# named-checkzone crushlinux.com
    /var/named/crushlinux.zheng
    [root@localhost ~]# named-checkzone crushlinux.com
    /var/named/crushlinux.fan
    [root@localhost ~]# systemctl restart named

    ==========================================================
    =====================
    从服务器:
    [root@localhost ~]# yum -y install bind
    [root@localhost ~]# vim /etc/resolv.conf
    # Generated by NetworkManager
    nameserver 192.168.200.111
    nameserver 192.168.200.112
    [root@localhost ~]# vim /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4
    localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6
    localhost6.localdomain6
    192.168.200.111 ns1.crushlinux.com
    192.168.200.112 ns2.crushlinux.com


    [root@localhost ~]# vim /etc/named.conf
    options {
    directory "/var/named";
    };

    zone "crushlinux.com" IN {
    type slave;
    file "slaves/crushlinux.zheng";
    masters { 192.168.200.111; };
    };
    zone "200.168.192.in-addr.arpa" IN {
    type slave;
    file "slaves/crushlinux.fan";
    masters { 192.168.200.111; };
    };

    [root@localhost ~]# systemctl restart named

  • 相关阅读:
    Leetcode 1711. 大餐计数(桶)
    macOS下安装powerline-status失败(报错Could not install packages due to an EnvironmentError)
    macOS下安装oh my zsh失败(报错Connection refused)
    Chapter 10 Operator Overloading
    牛客IOI周赛26-普及组 B. 子序列(int128)
    关于状压DP中子集状态的枚举
    2021蓝桥杯省赛第一场C/C++A组 试题E:回路计数(状压DP)
    AcWing 2879. 画中漂流(简单DP)
    Leetcode 525. 连续数组(前缀和性质/map)
    牛客小白月赛34 B. dd爱探险(状压DP)
  • 原文地址:https://www.cnblogs.com/L1-5551/p/11438941.html
Copyright © 2020-2023  润新知