DNS主从服务器中域(zone)文件类型不一致问题的解决方法

简介:

一、背景

公司的DNS服务器做了主从配置,最近在使用从服务器解析的时候,发现莫名其妙的解析不了,经过反复的检查,配置没有发现任何问题,在看域文件的时候,发现有乱码,问题应该就是出在这里了。通过file命令查看了一番,主服务器的域文件类型是text,从服务器的文件类型是data。

二、解决方法

(一)查阅资料

经过查阅官方资料,BIND9的域文件支持以其他格式读取或备份,raw格式是当前可用的一个附加格式,使用file命令查看文件类型显示是data,使用raw格式主要是为了提高加载速度。raw格式的域文件可以通过named-compilezone命令来进行转换,从而达到编辑的目的,这样操作显然比较麻烦了。

In addition to the standard textual format, BIND 9 supports the ability to read or dump to zone files
in other formats. The raw format is currently available as an additional format. It is a binary format

representing BIND 9’s internal data structure directly, thereby remarkably improving the loading time.
For a primary server, a zone file in the raw format is expected to be generated from a textual zone file
by the named-compilezone command. For a secondary server or for a dynamic zone, it is automatically
generated (if this format is specified by the masterfile-format option) when named dumps the zone
contents after zone transfer or when applying prior updates.
If a zone file in a binary format needs manual modification, it first must be converted to a textual form by
the named-compilezone command. All necessary modification should go to the text file, which should then be converted to the binary form by the named-compilezone command again.
Although the raw format uses the network byte order and avoids architecture-dependent data alignment
so that it is as much portable as possible, it is primarily expected to be used inside the same single

  1. In order to export a zone file in the raw format or make a portable backup of the file, it is
  2. to convert the file to the standard textual representation.
(二)解决方法

1 . 在上面的资料中,仔细阅读masterfile-format这一行,似乎有了新的思路。

2 . 修改从服务器相关的配置文件(/etc/named.conf ),添加如下一行:

masterfile-format text ;

3 . 重启从服务器:

systemctl restart named

4 . 过几秒查看slave目录下的域文件内容,是否跟主服务器一致。

相关文章
|
1月前
|
网络协议 Linux
Linux DNS服务详解——DNS主从架构配置
Linux DNS服务详解——DNS主从架构配置
405 4
|
17天前
|
域名解析 网络协议 Linux
使用 Webmin+bind9快速搭建私有DNS服务器
使用 Webmin+bind9快速搭建私有DNS服务器
54 1
|
29天前
|
域名解析 存储 网络协议
Linux中搭建主从DNS服务器
搭建主从DNS架构以提升DNS服务的高可用性、负载均衡和数据冗余。主服务器配置涉及编辑`/etc/named.conf`,设置监听IP和允许查询的范围,并定义主区域及允许的数据传输。从服务器配置需指定为奴隶类型,并指明主服务器的IP。测试表明正反向查询解析均正常。注意配置文件的语法正确性和权限设置。
|
2月前
|
弹性计算 Ubuntu Windows
2024年部署幻兽帕鲁/Palworld服务器多少钱?阿里云帕鲁主机优惠价格解析
对于热爱《幻兽帕鲁》的玩家们来说,一个稳定、高效的游戏服务器是畅享游戏乐趣的关键。那么,搭建一个这样的服务器需要多少钱呢?别担心,阿里云已经为大家准备了超值的幻兽帕鲁Palworld游戏服务器!
|
13天前
|
监控 负载均衡 网络协议
DNS服务器的搭建之初体验
通过这些步骤,你可以在初次搭建DNS服务器时获得基本的体验,了解如何为域名提供解析服务,促进网络的正常运行。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
34 7
|
20天前
|
网络协议 Linux 网络安全
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
17 0
|
2月前
|
弹性计算 固态存储 Linux
阿里云上Palworld/幻兽帕鲁服务器搭建全解析:超详细步骤,轻松掌握
想要在阿里云上轻松开服玩《幻兽帕鲁》吗?跟着我们的步骤来,简单几步就能搞定!
|
2月前
|
弹性计算 Ubuntu Linux
新手也能玩转幻兽帕鲁联机服务器:Palworld/幻兽帕鲁搭建攻略全解析
随着《幻兽帕鲁》的持续火爆,越来越多的玩家希望与好友在这款游戏中共同冒险。为了实现这一愿望,搭建一个属于自己的《幻兽帕鲁》服务器成为不少玩家的首选。今天,就为大家带来一篇关于如何轻松搭建《幻兽帕鲁》服务器的完整攻略,即使你是新手小白,也能轻松上手!
21 0
|
2月前
|
弹性计算 Ubuntu Linux
2024年Palworld/幻兽帕鲁服务器自建手册:详细步骤解析与设置指南
爆款游戏《幻兽帕鲁》是很多玩家在与好友开黑时的首选,因为《幻兽帕鲁》有着十分丰富的游戏内容,玩家在联机游玩《幻兽帕鲁》时能够获得非常多的快乐。 但在《幻兽帕鲁》进行联机时,是需要自行搭建服务器的,下面就带来,最新《幻兽帕鲁》服务器设置全步骤大全,方便玩家更好的进行联机游玩。 以下就是幻兽帕鲁服务器自建:幻兽帕鲁服务器设置全步骤大全的相关内容。
49 3
|
2月前
|
存储 弹性计算 安全
2024阿里云服务器ECS全方位解析_云主机详解
2024阿里云服务器ECS全方位解析_云主机详解,阿里云服务器是什么?云服务器ECS是一种安全可靠、弹性可伸缩的云计算服务,云服务器可以降低IT成本提升运维效率,免去企业或个人前期采购IT硬件的成本,阿里云服务器让用户像使用水、电、天然气等公共资源一样便捷、高效地使用服务器

相关产品

  • 云解析DNS
  • 推荐镜像

    更多