From 7f80170eb7486be9cffaf919cf2dd6b59bd7b389 Mon Sep 17 00:00:00 2001 From: zzlyzq Date: Mon, 28 Apr 2014 21:28:16 +0800 Subject: [PATCH 1/6] zzlyzq translating --- sources/tech/How to set up a secondary DNS server in CentOS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/tech/How to set up a secondary DNS server in CentOS.md b/sources/tech/How to set up a secondary DNS server in CentOS.md index 2aaa0d0095..81bef24e31 100644 --- a/sources/tech/How to set up a secondary DNS server in CentOS.md +++ b/sources/tech/How to set up a secondary DNS server in CentOS.md @@ -1,3 +1,4 @@ +[zzlyzq translating] How to set up a secondary DNS server in CentOS ================================================================================ In the [previous tutorial][1], we created a primary DNS server (ns1) for a test domain example.tst. In this tutorial, we will create a secondary DNS server (ns2) for the same domain by using bind package on CentOS. @@ -184,4 +185,4 @@ via: http://xmodulo.com/2014/04/secondary-dns-server-centos.html 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [1]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html -[2]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html \ No newline at end of file +[2]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html From a85c83f90d8d2a0c8c019c9bd046efddd89d0216 Mon Sep 17 00:00:00 2001 From: Jacky Date: Mon, 28 Apr 2014 22:12:19 +0800 Subject: [PATCH 2/6] zzlyzq commit on my web --- ...set up a secondary DNS server in CentOS.md | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/sources/tech/How to set up a secondary DNS server in CentOS.md b/sources/tech/How to set up a secondary DNS server in CentOS.md index 81bef24e31..2c511b4d2b 100644 --- a/sources/tech/How to set up a secondary DNS server in CentOS.md +++ b/sources/tech/How to set up a secondary DNS server in CentOS.md @@ -1,53 +1,71 @@ [zzlyzq translating] +在CentOS中如何创建辅DNS服务器 How to set up a secondary DNS server in CentOS ================================================================================ In the [previous tutorial][1], we created a primary DNS server (ns1) for a test domain example.tst. In this tutorial, we will create a secondary DNS server (ns2) for the same domain by using bind package on CentOS. +在[前边的教程][1],我们为一个测试域exmample.tst创建了一个主要DNS服务器(ns1)。在这边教程中,我们会使用bind包在CentOS中未相同的域创建一个辅DNS服务器(ns2)。 When it comes to setting up a secondary DNS server, the following factors should be kept in mind. +当创建一个辅DNS服务器的时候,下面的因素需要仔细考虑。 - You do NOT need to manually create forward and reverse zone files in the secondary DNS server. The zone files will be periodically synced from the primary DNS server automatically. -- Whenever any zone file is modified in the primary DNS server, the parameter 'serial' should be updated. The secondary DNS server will initiate synchronization (zone transfer) only if serial at the primary server has been changed. +- 在辅DNS服务器中,你不需要手动创建正向和反向区域文件。这些区域文件会定期从主DNS服务器上面同步。 +- Whenever any zone file is modified in the primary DNS server, the parameter 'serial' should be updated. The secondary DNS server will initiate synchronization (zone transfer) only if serial at the primary server has been changed. +- 当主DNS服务器上的任何区域文件被修改的时候,'serial'参数也应当被更新。只有当主服务器上面区域文件的serial被修改之后,辅DNS服务器才会进行同步。 We assume that the IP address of the secondary DNS server to be set up is 172.16.1.4. Let us start installing. +我们假设辅DNS服务器的IP地址是172.16.1.4。让我们来进行安装。 ### Setting up Hostnames ### +### 设置主机名 ### Just like the primary DNS server, the hostname of the secondary name server should be defined as FQDN properly. +就像主域名服务器一样,辅域名服务器的主机名也应当是一个合适的正式域名。 # vim /etc/sysconfig/network > HOSTNAME=ns2.example.tst Note that the hostname parameter specified in this file is used while the server is booting up. Therefore, the change does not take effect immediately. The following command can be used to change the hostname of a server immediately at run-time. +注意,在该文件中设置的主机名在服务器启动的时候会被使用。因此,如果你在系统启动之后修改,不会立刻生效。下面的命令可以用来在系统运行的时候立即修改。 # hostname ns2.example.tst Once set, hostname can be verified using the following command. +设置之后,可以用下面的命令来查看主机名称。 # hostname > ns2.example.tst Before proceeding to the next step, make sure that the hostname of all three servers are set properly. +在进行下面的步骤之前,确保所有三台服务器的主机名称已经被正确设置。 ### Installing Packages ### +### 安装软件包 ### Just like a [primary server][2], a secondary DNS server can be set up with or without chroot. Necessary packages can be easily installed using yum. +就像[主服务器][2]一样,配置一台辅域名服务器可以使用chroot或者不用。必须的软件包可以使用yum轻松安装。 Without chroot: +不使用 chroot: # yum install bind With chroot: +使用 chroot: # yum install bind-chroot ### Preparing Configuration File for Zone Transfers ### +### 为区域文件的传输准备配置文件 ### The DNS server powered by bind on CentOS will by default allow zone transfers for any requesting server. For security reasons, we need to configure the primary DNS server, such that it permits zone transfers to the secondary DNS server (172.16.1.4) only. +在CentOS中使用bind创建域名服务器后,默认设置允许所有的区域文件被任意服务器同步。安全起见,我们需要配置主域名服务器,只允许它允许辅域名服务器进行同步。 #### 1. Primary DNS Server #### + Without chroot: # vim /etc/named.conf @@ -55,7 +73,7 @@ Without chroot: With chroot: # vim /var/named/chroot/etc/named.conf - + ---------- zone "example.tst" IN { @@ -64,7 +82,7 @@ With chroot: allow-update { none; }; allow-transfer {172.16.1.4; }; ## NS2 is permitted ## }; - + zone "1.16.172.in-addr.arpa" IN { type master; file "rz-172-16-1"; ##the zone file hosted at NS1## @@ -85,13 +103,13 @@ With chroot: # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /var/named/chroot/etc/named.conf After the sample configuration file is copied over, the following lines are added/modified. - + options { directory "/var/named"; forwarders {8.8.8.8; }; - + }; - + zone "example.tst" IN { type slave; ## NS2 role is defined ## file "example-fz"; ## the name of the zone file to be automatically created ## @@ -99,7 +117,7 @@ After the sample configuration file is copied over, the following lines are adde allow-transfer {172.16.1.3; }; ## NS1 is allowed for zone transfer when necessary ## masters {172.16.1.3; }; ## the master NS1 is defined ## }; - + zone "1.16.172.in-addr.arpa" IN { type slave; ## NS2 role is defined ## file "rz-172-16-1"; ## the name of the zone file to be automatically created ## @@ -137,22 +155,22 @@ We can use dig or nslookup to test DNS operations. We will be demonstrating the ---------- > server 172.16.1.4 - Default server: 172.16.1.4 - Address: 172.16.1.4#53 + Default server: 172.16.1.4 + Address: 172.16.1.4#53 > example.tst - Server: 172.16.1.4 - Address: 172.16.1.4#53 + Server: 172.16.1.4 + Address: 172.16.1.4#53 - Name: example.tst - Address: 172.16.1.3 + Name: example.tst + Address: 172.16.1.3 > set type=mx > example.tst - Server: 172.16.1.4 - Address: 172.16.1.4#53 + Server: 172.16.1.4 + Address: 172.16.1.4#53 - example.tst mail exchanger = 10 mail.example.tst. + example.tst mail exchanger = 10 mail.example.tst. > exit From 4e934729b384668aed15368d5721fb7c1e23fb35 Mon Sep 17 00:00:00 2001 From: Jacky Date: Tue, 29 Apr 2014 10:49:34 +0800 Subject: [PATCH 3/6] translated translated --- ...set up a secondary DNS server in CentOS.md | 112 ++++++++---------- 1 file changed, 50 insertions(+), 62 deletions(-) diff --git a/sources/tech/How to set up a secondary DNS server in CentOS.md b/sources/tech/How to set up a secondary DNS server in CentOS.md index 2c511b4d2b..5d1d6ddd30 100644 --- a/sources/tech/How to set up a secondary DNS server in CentOS.md +++ b/sources/tech/How to set up a secondary DNS server in CentOS.md @@ -1,76 +1,61 @@ -[zzlyzq translating] -在CentOS中如何创建辅DNS服务器 -How to set up a secondary DNS server in CentOS -================================================================================ -In the [previous tutorial][1], we created a primary DNS server (ns1) for a test domain example.tst. In this tutorial, we will create a secondary DNS server (ns2) for the same domain by using bind package on CentOS. -在[前边的教程][1],我们为一个测试域exmample.tst创建了一个主要DNS服务器(ns1)。在这边教程中,我们会使用bind包在CentOS中未相同的域创建一个辅DNS服务器(ns2)。 +[zzlyzq translated] + +如何在CentOS中创建辅域名服务器 +================================================================================ +在[上篇教程][1]里,我们为一个测试域exmample.tst创建了一个主域名服务器(ns1)。在本篇中,我们会在CentOS中使用bind包为相同的域创建一个辅域名服务器(ns2)。 -When it comes to setting up a secondary DNS server, the following factors should be kept in mind. 当创建一个辅DNS服务器的时候,下面的因素需要仔细考虑。 -- You do NOT need to manually create forward and reverse zone files in the secondary DNS server. The zone files will be periodically synced from the primary DNS server automatically. -- 在辅DNS服务器中,你不需要手动创建正向和反向区域文件。这些区域文件会定期从主DNS服务器上面同步。 -- Whenever any zone file is modified in the primary DNS server, the parameter 'serial' should be updated. The secondary DNS server will initiate synchronization (zone transfer) only if serial at the primary server has been changed. -- 当主DNS服务器上的任何区域文件被修改的时候,'serial'参数也应当被更新。只有当主服务器上面区域文件的serial被修改之后,辅DNS服务器才会进行同步。 +- 在辅域名服务器中,你不需要手动创建正向和反向区域文件。这些区域文件会定期从主域名服务器上面同步。 +- 当主域名服务器上的任何区域文件被修改的时候,'serial'参数也应当被更新。只有当主服务器上面区域文件的serial被修改之后,辅DNS服务器才会进行同步。 -We assume that the IP address of the secondary DNS server to be set up is 172.16.1.4. Let us start installing. 我们假设辅DNS服务器的IP地址是172.16.1.4。让我们来进行安装。 -### Setting up Hostnames ### ### 设置主机名 ### -Just like the primary DNS server, the hostname of the secondary name server should be defined as FQDN properly. 就像主域名服务器一样,辅域名服务器的主机名也应当是一个合适的正式域名。 # vim /etc/sysconfig/network > HOSTNAME=ns2.example.tst -Note that the hostname parameter specified in this file is used while the server is booting up. Therefore, the change does not take effect immediately. The following command can be used to change the hostname of a server immediately at run-time. -注意,在该文件中设置的主机名在服务器启动的时候会被使用。因此,如果你在系统启动之后修改,不会立刻生效。下面的命令可以用来在系统运行的时候立即修改。 +注意,在该文件中设置的主机名在服务器启动的时候会被使用。因此,如果你在系统启动之后修改该文件,修改结果不会立刻生效。下面的命令可以用来在系统运行的时候修改并及时生效。 # hostname ns2.example.tst -Once set, hostname can be verified using the following command. 设置之后,可以用下面的命令来查看主机名称。 # hostname > ns2.example.tst -Before proceeding to the next step, make sure that the hostname of all three servers are set properly. -在进行下面的步骤之前,确保所有三台服务器的主机名称已经被正确设置。 +在进行下面的步骤之前,确保所有三台[3]服务器的主机名称已经被正确设置。 -### Installing Packages ### ### 安装软件包 ### -Just like a [primary server][2], a secondary DNS server can be set up with or without chroot. Necessary packages can be easily installed using yum. 就像[主服务器][2]一样,配置一台辅域名服务器可以使用chroot或者不用。必须的软件包可以使用yum轻松安装。 -Without chroot: 不使用 chroot: # yum install bind -With chroot: 使用 chroot: # yum install bind-chroot -### Preparing Configuration File for Zone Transfers ### ### 为区域文件的传输准备配置文件 ### -The DNS server powered by bind on CentOS will by default allow zone transfers for any requesting server. For security reasons, we need to configure the primary DNS server, such that it permits zone transfers to the secondary DNS server (172.16.1.4) only. 在CentOS中使用bind创建域名服务器后,默认设置允许所有的区域文件被任意服务器同步。安全起见,我们需要配置主域名服务器,只允许它允许辅域名服务器进行同步。 -#### 1. Primary DNS Server #### +#### 1. 主域名服务器 #### -Without chroot: +不使用chroot: # vim /etc/named.conf -With chroot: +使用chroot: + # vim /var/named/chroot/etc/named.conf @@ -78,31 +63,32 @@ With chroot: zone "example.tst" IN { type master; - file "example-fz"; ## the zone file hosted at NS1 ## + file "example-fz"; ## 文件example-fz在主域名服务器上 ## allow-update { none; }; - allow-transfer {172.16.1.4; }; ## NS2 is permitted ## + allow-transfer {172.16.1.4; }; ## 辅域名服务器被允许 ## }; zone "1.16.172.in-addr.arpa" IN { type master; - file "rz-172-16-1"; ##the zone file hosted at NS1## + file "rz-172-16-1"; ##文件rz-172-16-1在主域名服务器上## allow-update { none; }; - allow-transfer {172.16.1.4; }; ## NS2 is permitted ## + allow-transfer {172.16.1.4; }; ## 辅域名服务器被允许 ## }; -#### 2. Secondary DNS Server #### +#### 2. 辅域名服务器 #### -The default configuration file provided with the installation could be used to configure the secondary server. However, we will be using another sample configuration file as it is easier to tune. +软件安装后提供的默认配置文件就可以用来配置辅域名服务器。但是,我们使用会使用另外一个实例配置文件来进行配置,因为这样便于调整。 -Without chroot: +不使用chroot: # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /etc/named.conf -With chroot: +使用chroot: + # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /var/named/chroot/etc/named.conf -After the sample configuration file is copied over, the following lines are added/modified. +当执行完上面的命令进行文件拷贝后,添加下面的内容到刚才那个拷贝后的文件中。 options { directory "/var/named"; @@ -111,43 +97,44 @@ After the sample configuration file is copied over, the following lines are adde }; zone "example.tst" IN { - type slave; ## NS2 role is defined ## - file "example-fz"; ## the name of the zone file to be automatically created ## + type slave; ## 该主机为辅域名服务器 ## + file "example-fz"; ## 这个文件会被自动创建 ## //allow-update { none; }; - allow-transfer {172.16.1.3; }; ## NS1 is allowed for zone transfer when necessary ## - masters {172.16.1.3; }; ## the master NS1 is defined ## + allow-transfer {172.16.1.3; }; ## 定义必要时进行传输的主域名服务器 ## + masters {172.16.1.3; }; ## 定义主域名服务器 ## }; zone "1.16.172.in-addr.arpa" IN { - type slave; ## NS2 role is defined ## - file "rz-172-16-1"; ## the name of the zone file to be automatically created ## + type slave; ## 该主机被定义为辅域名服务器 ## + file "rz-172-16-1"; ## 这个文件会被自动创建 ## // allow-update { none; }; - allow-transfer {172.16.1.3; }; ## the master NS1 is defined ## + allow-transfer {172.16.1.3; }; ## 定义主域名服务器 ## masters {172.16.1.3; }; }; -### Finalizing Installation ### +### 结束配置 ### -To make sure that there is no permission related issues, we need to adjust the following. +为了确保没有权限相关的问题,我们需要做如下调整。 -Without chroot: +不使用chroot: chmod 770 /var/named/ -With chroot, you need to modify the permission as follows AFTER named service has started. +使用chroot,你需在named服务启动后按照下面的命令修改权限。 # chmod 770 /var/named/chroot/var/named -Now that everything is ready, we can restart named service. Also, make sure that named service is added to startup list. +现在万事俱备,我们可以重启named服务。或者,确保named服务已经被加到了开始列表中。 # service named restart # chkconfig named on -If all goes well, the secondary DNS server should request a zone transfer from the primary DNS server, and populate its own /var/named. The log file /var/log/messages should contain useful information about the status of the named service as well as the zone transfer. +如果不出意外,辅域名服务器应该会向主域名服务器请求一个区域的传输,并且产生自己的/var/named。日志文件/var/log/messages会包含一些named服务 +的有用信息,包括区域文件传输过程中的信息。 -### Testing a Secondary DNS Server ### +### 测试一个辅域名服务器 ### -We can use dig or nslookup to test DNS operations. We will be demonstrating the use of nslookup in this tutorial. Necessary packages can be installed using yum. +我们可以使用dig或者nslookup进行DNS测试操作。在本篇教程中我们会使用nslookup来进行演示。必要的软件包可以通过yum进行安装。 # yum install bind-utils # nslookup @@ -174,33 +161,34 @@ We can use dig or nslookup to test DNS operations. We will be demonstrating the > exit -### Troubleshooting ### +### 排除障碍 ### -1. We do not need to create any zone files in the secondary DNS server. All the zone files will be synchronized from the primary server. +1. 我们无需在辅域名服务器上创建任何区域文件。所有的区域文件都会与主域名服务器进行同步。 -2. The named service at the secondary server will periodically initiate zone transfers with the primary server. If you want to force a one-time zone transfer, the command "rndc retransfer " can be used. For example: +2. 辅域名服务器上的named服务会定期与主服务器进行同步。如果你想来一次及时的同步,可以使用命令"rncd retransfer "。如下: # rndc retransfer example.tst -3. A secondary DNS server will update its zone files only if the serial at the primary server has been modified/incremented. +3. 只有当主服务器上区域文件的serial数字被修改/变大的时候,辅域名服务器才会进行更新。 -4. Make sure that the directory /var/named or /var/named/chroot/var/named (in case of chroot) is writable by named user. +4. 确保用户named可以对文件夹/var/named或者/var/named/chroot/var/named(使用chroot的情况下)进行写操作。 -5. /var/log/messages should contain useful information. +5. /var/log/messages会包含有用的信息。 -6. I have SELinux turned off. +6. 我已经将SELinux关闭了。 -7. Make sure UDP port 53 is allowed in the firewall. +7. 确保防火墙对UDP53端口开放。 -Hope this helps. +希望这个可以帮到你。 -------------------------------------------------------------------------------- via: http://xmodulo.com/2014/04/secondary-dns-server-centos.html -译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) +译者:[zzlyzq](https://github.com/zzlyzq) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 [1]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html [2]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html +[3]:译者注,怎么可能是三呢,我认为应该是二 From fb4309a516a68f46a437459ed79e4d064e6818dc Mon Sep 17 00:00:00 2001 From: Jacky Date: Tue, 29 Apr 2014 10:50:34 +0800 Subject: [PATCH 4/6] translated translated --- ...set up a secondary DNS server in CentOS.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 translated/tech/How to set up a secondary DNS server in CentOS.md diff --git a/translated/tech/How to set up a secondary DNS server in CentOS.md b/translated/tech/How to set up a secondary DNS server in CentOS.md new file mode 100644 index 0000000000..5d1d6ddd30 --- /dev/null +++ b/translated/tech/How to set up a secondary DNS server in CentOS.md @@ -0,0 +1,194 @@ +[zzlyzq translated] + +如何在CentOS中创建辅域名服务器 +================================================================================ +在[上篇教程][1]里,我们为一个测试域exmample.tst创建了一个主域名服务器(ns1)。在本篇中,我们会在CentOS中使用bind包为相同的域创建一个辅域名服务器(ns2)。 + +当创建一个辅DNS服务器的时候,下面的因素需要仔细考虑。 + +- 在辅域名服务器中,你不需要手动创建正向和反向区域文件。这些区域文件会定期从主域名服务器上面同步。 +- 当主域名服务器上的任何区域文件被修改的时候,'serial'参数也应当被更新。只有当主服务器上面区域文件的serial被修改之后,辅DNS服务器才会进行同步。 + +我们假设辅DNS服务器的IP地址是172.16.1.4。让我们来进行安装。 + +### 设置主机名 ### + +就像主域名服务器一样,辅域名服务器的主机名也应当是一个合适的正式域名。 + + # vim /etc/sysconfig/network + +> HOSTNAME=ns2.example.tst + +注意,在该文件中设置的主机名在服务器启动的时候会被使用。因此,如果你在系统启动之后修改该文件,修改结果不会立刻生效。下面的命令可以用来在系统运行的时候修改并及时生效。 + + # hostname ns2.example.tst + +设置之后,可以用下面的命令来查看主机名称。 + + # hostname + +> ns2.example.tst + +在进行下面的步骤之前,确保所有三台[3]服务器的主机名称已经被正确设置。 + +### 安装软件包 ### + +就像[主服务器][2]一样,配置一台辅域名服务器可以使用chroot或者不用。必须的软件包可以使用yum轻松安装。 + +不使用 chroot: + + # yum install bind + +使用 chroot: + + # yum install bind-chroot + +### 为区域文件的传输准备配置文件 ### + +在CentOS中使用bind创建域名服务器后,默认设置允许所有的区域文件被任意服务器同步。安全起见,我们需要配置主域名服务器,只允许它允许辅域名服务器进行同步。 + +#### 1. 主域名服务器 #### + + +不使用chroot: + + # vim /etc/named.conf + +使用chroot: + + + # vim /var/named/chroot/etc/named.conf + +---------- + + zone "example.tst" IN { + type master; + file "example-fz"; ## 文件example-fz在主域名服务器上 ## + allow-update { none; }; + allow-transfer {172.16.1.4; }; ## 辅域名服务器被允许 ## + }; + + zone "1.16.172.in-addr.arpa" IN { + type master; + file "rz-172-16-1"; ##文件rz-172-16-1在主域名服务器上## + allow-update { none; }; + allow-transfer {172.16.1.4; }; ## 辅域名服务器被允许 ## + }; + +#### 2. 辅域名服务器 #### + +软件安装后提供的默认配置文件就可以用来配置辅域名服务器。但是,我们使用会使用另外一个实例配置文件来进行配置,因为这样便于调整。 + +不使用chroot: + + # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /etc/named.conf + +使用chroot: + + + # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /var/named/chroot/etc/named.conf + +当执行完上面的命令进行文件拷贝后,添加下面的内容到刚才那个拷贝后的文件中。 + + options { + directory "/var/named"; + forwarders {8.8.8.8; }; + + }; + + zone "example.tst" IN { + type slave; ## 该主机为辅域名服务器 ## + file "example-fz"; ## 这个文件会被自动创建 ## + //allow-update { none; }; + allow-transfer {172.16.1.3; }; ## 定义必要时进行传输的主域名服务器 ## + masters {172.16.1.3; }; ## 定义主域名服务器 ## + }; + + zone "1.16.172.in-addr.arpa" IN { + type slave; ## 该主机被定义为辅域名服务器 ## + file "rz-172-16-1"; ## 这个文件会被自动创建 ## + // allow-update { none; }; + allow-transfer {172.16.1.3; }; ## 定义主域名服务器 ## + masters {172.16.1.3; }; + }; + +### 结束配置 ### + +为了确保没有权限相关的问题,我们需要做如下调整。 + +不使用chroot: + + chmod 770 /var/named/ + +使用chroot,你需在named服务启动后按照下面的命令修改权限。 + + # chmod 770 /var/named/chroot/var/named + +现在万事俱备,我们可以重启named服务。或者,确保named服务已经被加到了开始列表中。 + + # service named restart + # chkconfig named on + +如果不出意外,辅域名服务器应该会向主域名服务器请求一个区域的传输,并且产生自己的/var/named。日志文件/var/log/messages会包含一些named服务 +的有用信息,包括区域文件传输过程中的信息。 + +### 测试一个辅域名服务器 ### + +我们可以使用dig或者nslookup进行DNS测试操作。在本篇教程中我们会使用nslookup来进行演示。必要的软件包可以通过yum进行安装。 + + # yum install bind-utils + # nslookup + +---------- + + > server 172.16.1.4 + Default server: 172.16.1.4 + Address: 172.16.1.4#53 + + > example.tst + Server: 172.16.1.4 + Address: 172.16.1.4#53 + + Name: example.tst + Address: 172.16.1.3 + + > set type=mx + > example.tst + Server: 172.16.1.4 + Address: 172.16.1.4#53 + + example.tst mail exchanger = 10 mail.example.tst. + + > exit + +### 排除障碍 ### + +1. 我们无需在辅域名服务器上创建任何区域文件。所有的区域文件都会与主域名服务器进行同步。 + +2. 辅域名服务器上的named服务会定期与主服务器进行同步。如果你想来一次及时的同步,可以使用命令"rncd retransfer "。如下: + + # rndc retransfer example.tst + +3. 只有当主服务器上区域文件的serial数字被修改/变大的时候,辅域名服务器才会进行更新。 + +4. 确保用户named可以对文件夹/var/named或者/var/named/chroot/var/named(使用chroot的情况下)进行写操作。 + +5. /var/log/messages会包含有用的信息。 + +6. 我已经将SELinux关闭了。 + +7. 确保防火墙对UDP53端口开放。 + +希望这个可以帮到你。 + +-------------------------------------------------------------------------------- + +via: http://xmodulo.com/2014/04/secondary-dns-server-centos.html + +译者:[zzlyzq](https://github.com/zzlyzq) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html +[2]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html +[3]:译者注,怎么可能是三呢,我认为应该是二 From 93048ae9ceb2636cf148d3314866f25765c52eac Mon Sep 17 00:00:00 2001 From: Jacky Date: Tue, 29 Apr 2014 10:51:57 +0800 Subject: [PATCH 5/6] translated Already translated by zzlyzq, and make a new file under translated/tech directory. --- ...set up a secondary DNS server in CentOS.md | 194 ------------------ 1 file changed, 194 deletions(-) delete mode 100644 sources/tech/How to set up a secondary DNS server in CentOS.md diff --git a/sources/tech/How to set up a secondary DNS server in CentOS.md b/sources/tech/How to set up a secondary DNS server in CentOS.md deleted file mode 100644 index 5d1d6ddd30..0000000000 --- a/sources/tech/How to set up a secondary DNS server in CentOS.md +++ /dev/null @@ -1,194 +0,0 @@ -[zzlyzq translated] - -如何在CentOS中创建辅域名服务器 -================================================================================ -在[上篇教程][1]里,我们为一个测试域exmample.tst创建了一个主域名服务器(ns1)。在本篇中,我们会在CentOS中使用bind包为相同的域创建一个辅域名服务器(ns2)。 - -当创建一个辅DNS服务器的时候,下面的因素需要仔细考虑。 - -- 在辅域名服务器中,你不需要手动创建正向和反向区域文件。这些区域文件会定期从主域名服务器上面同步。 -- 当主域名服务器上的任何区域文件被修改的时候,'serial'参数也应当被更新。只有当主服务器上面区域文件的serial被修改之后,辅DNS服务器才会进行同步。 - -我们假设辅DNS服务器的IP地址是172.16.1.4。让我们来进行安装。 - -### 设置主机名 ### - -就像主域名服务器一样,辅域名服务器的主机名也应当是一个合适的正式域名。 - - # vim /etc/sysconfig/network - -> HOSTNAME=ns2.example.tst - -注意,在该文件中设置的主机名在服务器启动的时候会被使用。因此,如果你在系统启动之后修改该文件,修改结果不会立刻生效。下面的命令可以用来在系统运行的时候修改并及时生效。 - - # hostname ns2.example.tst - -设置之后,可以用下面的命令来查看主机名称。 - - # hostname - -> ns2.example.tst - -在进行下面的步骤之前,确保所有三台[3]服务器的主机名称已经被正确设置。 - -### 安装软件包 ### - -就像[主服务器][2]一样,配置一台辅域名服务器可以使用chroot或者不用。必须的软件包可以使用yum轻松安装。 - -不使用 chroot: - - # yum install bind - -使用 chroot: - - # yum install bind-chroot - -### 为区域文件的传输准备配置文件 ### - -在CentOS中使用bind创建域名服务器后,默认设置允许所有的区域文件被任意服务器同步。安全起见,我们需要配置主域名服务器,只允许它允许辅域名服务器进行同步。 - -#### 1. 主域名服务器 #### - - -不使用chroot: - - # vim /etc/named.conf - -使用chroot: - - - # vim /var/named/chroot/etc/named.conf - ----------- - - zone "example.tst" IN { - type master; - file "example-fz"; ## 文件example-fz在主域名服务器上 ## - allow-update { none; }; - allow-transfer {172.16.1.4; }; ## 辅域名服务器被允许 ## - }; - - zone "1.16.172.in-addr.arpa" IN { - type master; - file "rz-172-16-1"; ##文件rz-172-16-1在主域名服务器上## - allow-update { none; }; - allow-transfer {172.16.1.4; }; ## 辅域名服务器被允许 ## - }; - -#### 2. 辅域名服务器 #### - -软件安装后提供的默认配置文件就可以用来配置辅域名服务器。但是,我们使用会使用另外一个实例配置文件来进行配置,因为这样便于调整。 - -不使用chroot: - - # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /etc/named.conf - -使用chroot: - - - # cp /usr/share/doc/bind-9.8.2/sample/etc/named.rfc1912.zones /var/named/chroot/etc/named.conf - -当执行完上面的命令进行文件拷贝后,添加下面的内容到刚才那个拷贝后的文件中。 - - options { - directory "/var/named"; - forwarders {8.8.8.8; }; - - }; - - zone "example.tst" IN { - type slave; ## 该主机为辅域名服务器 ## - file "example-fz"; ## 这个文件会被自动创建 ## - //allow-update { none; }; - allow-transfer {172.16.1.3; }; ## 定义必要时进行传输的主域名服务器 ## - masters {172.16.1.3; }; ## 定义主域名服务器 ## - }; - - zone "1.16.172.in-addr.arpa" IN { - type slave; ## 该主机被定义为辅域名服务器 ## - file "rz-172-16-1"; ## 这个文件会被自动创建 ## - // allow-update { none; }; - allow-transfer {172.16.1.3; }; ## 定义主域名服务器 ## - masters {172.16.1.3; }; - }; - -### 结束配置 ### - -为了确保没有权限相关的问题,我们需要做如下调整。 - -不使用chroot: - - chmod 770 /var/named/ - -使用chroot,你需在named服务启动后按照下面的命令修改权限。 - - # chmod 770 /var/named/chroot/var/named - -现在万事俱备,我们可以重启named服务。或者,确保named服务已经被加到了开始列表中。 - - # service named restart - # chkconfig named on - -如果不出意外,辅域名服务器应该会向主域名服务器请求一个区域的传输,并且产生自己的/var/named。日志文件/var/log/messages会包含一些named服务 -的有用信息,包括区域文件传输过程中的信息。 - -### 测试一个辅域名服务器 ### - -我们可以使用dig或者nslookup进行DNS测试操作。在本篇教程中我们会使用nslookup来进行演示。必要的软件包可以通过yum进行安装。 - - # yum install bind-utils - # nslookup - ----------- - - > server 172.16.1.4 - Default server: 172.16.1.4 - Address: 172.16.1.4#53 - - > example.tst - Server: 172.16.1.4 - Address: 172.16.1.4#53 - - Name: example.tst - Address: 172.16.1.3 - - > set type=mx - > example.tst - Server: 172.16.1.4 - Address: 172.16.1.4#53 - - example.tst mail exchanger = 10 mail.example.tst. - - > exit - -### 排除障碍 ### - -1. 我们无需在辅域名服务器上创建任何区域文件。所有的区域文件都会与主域名服务器进行同步。 - -2. 辅域名服务器上的named服务会定期与主服务器进行同步。如果你想来一次及时的同步,可以使用命令"rncd retransfer "。如下: - - # rndc retransfer example.tst - -3. 只有当主服务器上区域文件的serial数字被修改/变大的时候,辅域名服务器才会进行更新。 - -4. 确保用户named可以对文件夹/var/named或者/var/named/chroot/var/named(使用chroot的情况下)进行写操作。 - -5. /var/log/messages会包含有用的信息。 - -6. 我已经将SELinux关闭了。 - -7. 确保防火墙对UDP53端口开放。 - -希望这个可以帮到你。 - --------------------------------------------------------------------------------- - -via: http://xmodulo.com/2014/04/secondary-dns-server-centos.html - -译者:[zzlyzq](https://github.com/zzlyzq) 校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 - -[1]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html -[2]:http://xmodulo.com/2014/04/primary-dns-server-using-centos.html -[3]:译者注,怎么可能是三呢,我认为应该是二 From a45823ff2ad385f1f072c2b35346f1dc62d2e77f Mon Sep 17 00:00:00 2001 From: zzlyzq Date: Tue, 29 Apr 2014 12:23:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/How to set up a secondary DNS server in CentOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/How to set up a secondary DNS server in CentOS.md b/translated/tech/How to set up a secondary DNS server in CentOS.md index 5d1d6ddd30..e265462b0a 100644 --- a/translated/tech/How to set up a secondary DNS server in CentOS.md +++ b/translated/tech/How to set up a secondary DNS server in CentOS.md @@ -1,4 +1,4 @@ -[zzlyzq translated] +[Translated by zzlyzq] 如何在CentOS中创建辅域名服务器 ================================================================================