named服务记录

1.安装
rpm -ivh bind-version.rpm bind-chroot-version.rpm caching-nameserver-version.rpm bind-libs-version.rpm bind--utils-version.rpm
2.配置文件named.conf
zone "rilee.com" IN {type master; file "rilee.com.zone"; allow-transfer {192.168.0.5;};};
zone "0.168.192.in-addr.arpa" IN {type master; file "rilee.com.arpa"; allow-transfer {192.168.0.5;};};
正向文件:
$TTL        86400
@                             IN SOA    rilee.com. root.rilee.com. (
                                                                                20100511                ; serial (d. adams)
                                                                                3H                            ; refresh
                                                                                15M                         ; retry
                                                                                1W                            ; expiry
                                                                                1D )                        ; minimum
@                             IN MX 5                 mail.rilee.com.
@                             IN MX 4                 mail2.rilee.com.
@                             IN NS                     ns.rilee.com.
@                             IN NS                     ns2.rilee.com.
ns                            IN A                        192.168.0.4
ns2                         IN A                        192.168.0.5
www 10                    IN A                        192.168.0.168
www 9                     IN A                        192.168.0.167
www 8                     IN A                        192.168.0.166   \\这是一个负载轮询
ftp                         IN A                        192.168.0.165
ftp2                        IN CNAME                ftp
mail                        IN A                        192.168.0.164
mail2                     IN A                        192.168.0.163
$GENERATE 2-222 file$ IN A            192.168.0.$
*                             IN A                        192.168.0.168   \\两个泛匹配应用的还挺多的。
反向文件:
$TTL        86400
@                             IN SOA    rilee.com. root.rilee.com. (
                                                                                1                             ; serial (d. adams)
                                                                                3H                            ; refresh
                                                                                15M                         ; retry
                                                                                1W                            ; expiry
                                                                                1D )                        ; minimum
@             IN NS                     ns.rilee.com.
@             IN NS                     ns2.rilee.com.
4                             IN PTR                    ns.rilee.com.
5                             IN PTR                    ns2.rilee.com.
168                         IN PTR                    www.rilee.com.
168                         IN PTR                    www.rilee.com.
167                         IN PTR                    www.rilee.com.
166                         IN PTR                    www.rilee.com.
165                         IN PTR                    ftp.rilee.com.
164                         IN PTR                    mail.rilee.com.
163                         IN PTR                    mail2.rilee.com.
$GENERATE 2-222 $             IN PTR    file$.rilee.com.
3.从服务器配置:named.conf
zone "." IN {
                type hint;
                file "named.ca";
};

zone "rilee.com" IN {type slave;file "slaves/rilee.com.zone";masters {192.168.0.4;};};

zone "0.168.192.in-addr.arpa" IN {type slave;file "slaves/rilee.com.arpa";masters { 192.168.0.4;};};
4.服务启动
注意主服务器,如果默认启动的话,表面提示服务启动OK,但是实际上服务是不能正常解析的,查看日志问价tail -40 /var/log/message中有两条permission denied,是关于服务不能读取两个区域文件所致,因为named服务是用named账户运行的,所以对这两个文件没有读取权限所以不能加载。
chown :named /var/named/chroot/var/named/rilee.com*
这样修改重启服务便可。
5.从服务启动会从主服务器这里去走那两个配置文件,权限已修改,直接通过过来就可以用了。切记,要收动修改区域文件文件序列号,时期比主服务器的小才能重新加载。
6.从服从主服务器更新这些配置文件,两者的防火前需要加条允许才行。

本文出自 “追求卓越,成功迎面而来” 博客,转载请与作者联系!

你可能感兴趣的:(职场,记录,服务,休闲,named)