当前位置: 首页 > article >正文

DNF 主从服务器的搭建

1,主服务器的配置

  • 关闭防火墙和Linux的安全程序

[root@localhost ~]# systemctl stop firewalld.service #关闭防火墙
[root@localhost ~]# setenforce 0 #关闭安全策略
  • 下载DNS

[root@localhost ~]# dnf install bind -y
  • 配置操作

[root@localhost ~]# vim /etc/named.conf



options{
        listen-on port 53 { 192.168.85.136; };
        directory "/var/named";
        allow-query { any; };
        allow-transfer { 192.168.85.135; };
};

zone "openlab.com" IN {
        type master;
        file "named.openlab.com";
};

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

2,从服务器的配置 

  • 关闭防火墙和Linux的安全程序

[root@localhost ~]# systemctl stop firewalld.service #关闭防火墙
[root@localhost ~]# setenforce 0 #关闭安全策略
  • 下载DNS

[root@localhost ~]# dnf install bind -y
  • 配置操作

options{
        listen-on port 53 { 192.168.85.135; };
        directory "/var/named/slaves";
        allow-query { any; };
};

zone "openlab.com" IN {
        type slave;
        file "named.openlab.com";
        masters { 192.168.85.136; };
};

zone "85.168.192.in-addr.arpa" IN {
        type slave;
        file "named.192";
        masters { 192.168.85.136; };
};

3,完全区域传送

  • 主服务器:

[root@localhost ~]# vim /var/named/named.openlab.com



$TTL 1D
@       IN      SOA     @       lxx.qq.com. ( 
                                        2024110100
                                        1D
                                        1H
                                        5H
                                        1D
)
        IN      NS      ns.openlab.com.
ns      IN      A       192.168.85.136


www     IN      A       172.25.250.111
ftp     IN      A       172.25.250.100
mail    IN      A       172.25.250.132
wwww    IN      CNAME   www



[root@localhost ~]# systemctl restart named

 

  • 从服务器:

[root@localhost ~]# systemctl restart named



[root@localhost ~]# ll /var/named/slaves
total 16
-rw-r--r--. 1 named named  821 Nov  1 22:16 managed-keys.bind
-rw-r--r--. 1 named named 3733 Nov  1 22:16 managed-keys.bind.jnl
-rw-r--r--. 1 named named  463 Nov  1 21:52 named.192
-rw-r--r--. 1 named named  384 Nov  1 21:52 named.openlab.com

4,增量区域传送

  • 主服务器:

[root@localhost ~]# vim /var/named/named.openlab.com




$TTL 1D
@       IN      SOA     @       lxx.qq.com. ( 
                                        2024110101
                                        1M
                                        1M
                                        1M
                                        1M
)
        IN      NS      ns.openlab.com.
        IN      NS      slave.openlab.com.
ns      IN      A       192.168.85.136
slave   IN      A       192.168.85.135


www     IN      A       172.25.250.111
ftp     IN      A       172.25.250.100
mail    IN      A       172.25.250.132
wwww    IN      CNAME   www
wwwww   IN      CNAME   www



[root@localhost ~]# systemctl restart named

  • 从服务器:

[root@localhost ~]# tail -f /var/log/messages
Nov  1 22:23:57 localhost systemd[1]: Started Network Manager Script Dispatcher Service.
Nov  1 22:24:07 localhost systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Nov  1 22:37:01 localhost named[41618]: client @0x7f2924057a98 192.168.85.136#46600: received notify for zone 'openlab.com'
Nov  1 22:37:01 localhost named[41618]: zone openlab.com/IN: notify from 192.168.85.136#46600: serial 2024110101
Nov  1 22:37:01 localhost named[41618]: zone openlab.com/IN: Transfer started.
Nov  1 22:37:01 localhost named[41618]: transfer of 'openlab.com/IN' from 192.168.85.136#53: connected using 192.168.85.135#45691
Nov  1 22:37:01 localhost named[41618]: zone openlab.com/IN: transferred serial 2024110101
Nov  1 22:37:01 localhost named[41618]: transfer of 'openlab.com/IN' from 192.168.85.136#53: Transfer status: success
Nov  1 22:37:01 localhost named[41618]: transfer of 'openlab.com/IN' from 192.168.85.136#53: Transfer completed: 1 messages, 11 records, 280 bytes, 0.001 secs (280000 bytes/sec) (serial 2024110101)
Nov  1 22:37:01 localhost named[41618]: zone openlab.com/IN: sending notifies (serial 2024110101)



[root@localhost ~]# nslookup 
> server 192.168.85.135
Default server: 192.168.85.135
Address: 192.168.85.135#53
> slave.openlab.com
Server:		192.168.85.135
Address:	192.168.85.135#53

Name:	slave.openlab.com
Address: 192.168.85.135
> wwwww.openlab.com
Server:		192.168.85.135
Address:	192.168.85.135#53

wwwww.openlab.com	canonical name = www.openlab.com.
Name:	www.openlab.com
Address: 172.25.250.111


http://www.kler.cn/a/375455.html

相关文章:

  • Java/JDK下载、安装及环境配置超详细教程【Windows10、macOS和Linux图文详解】
  • 重拾设计模式--观察者模式
  • Java操作Xml
  • 中国量子计算机领域的发展现状与展望
  • flink实现复杂kafka数据读取
  • 深度学习——现代卷积神经网络(七)
  • 传输层协议之UDP
  • 调试EKF的MATLAB代码的关键点
  • 智能交通的未来:深度学习如何改变车辆检测游戏规则
  • 抓取和分析JSON数据:使用Python构建数据处理管道
  • 从一个双向链表中移除一个链表
  • 掌握AI Prompt的艺术:如何有效引导智能助手
  • Ubuntu 命令行教程介绍
  • 什么是制造项目管理?
  • shodan进阶-实战案例
  • 【Hive sql 面试题】统计每个成绩段人数(数据格式为 json),两种导入数据格式 + 两种解决方案
  • 深度学习之权重、偏差
  • mongodb指定引擎并设置内存使用大小
  • 微服务实战系列之玩转Docker(十七)
  • 人工智能基础 opencv
  • 【Orange Pi 5 Linux 5.x 内核编程】-等待队列(WaitQueue)
  • 0xGame 2024 [Week 4] Jenkins
  • 英伟达 GPU 架构:演进与模型推理速度的深度关联
  • 真题与解析 202109二级 青少年软件编程(Python)考级
  • echarts柱状图 x轴显示不完文字的处理方法和有些指标默认不显示的问题
  • 浅谈网络安全