1个域2台机器(1台dns服务器148,1台客户端142)
用mail时,需添加反向,正向中添加MX 5。MX 全称 mail exchanger
2台机器,dns都指向148,hosts添加2个ip
vim /etc/resolv.conf
nameserver 192.168.11.148
vim /etc/hosts
192.168.11.148 desktop148.example.com
192.168.11.142 desktop142.example.com
148装包 yum install bind bind-chroot -y
148/etc/named.conf,把一些参数删除或修改any或注释
148/etc/named.rfc1912.conf,添加example.com 域,正反向
148/var/named/,创建example.com.zoe文件
148/var/named,创建192.168.11.148.zone文件
复制模板时,cp -p 注意文件权限
142/etc/resolv.conf 指向192.168.11.148 就可以
vim /etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursion yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
添加example.com 域,正反向
vim /etc/named.rfc1912.zones
zone "example.com" IN {
type master;
file "example.com.zone";
allow-update { none; };
};
zone "11.168.192.in-addr.arpa" IN {
type master;
file "192.168.11.148.zone";
allow-update { none; };
};
创建example.com.zoe文件
vim example.com.zone
$TTL 1D @ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
MX 5 @
A 192.168.11.148
desktop142 A 192.168.11.142
desktop148 A 192.168.11.148
创建192.168.11.148.zone文件
vim 192.168.11.148.zone
$TTL 1D @ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS example.com.
142 PTR desktop142.example.com.
148 PTR desktop148.example.com.
nslookup desktop148.example.com
nslookup desktop142.example.com
nslookup 192.168.11.148
nslookup 192.168.11.142
----------------------------------------------------------------------------------------------------
2个域 ,2台机器,分别建域zzg.com postfix.com,分别正反向,resolv指向2个ip
修改主配置文件,把一些参数删除或修改any或注释
vim /etc/named.conf
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursion yes;
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
添加正反zone
vim /etc/named.rfc1912.zones
zone "zzg.com" IN {
type master;
file "";
allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "192.168.0.53.zone";
allow-update { none; };
};
正向解析
复制模板时,cp -p 注意权限
vim /var/named/ww.zzg.com
$TTL 1D @ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
MX 5 @
A 192.168.0.53
mail A 192.168.0.53
反向解析
vim /var/named/192.168.0.53.zone
$TTL 1D @ IN SOA @ rname.invalid. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS zzg.com.
53 PTR zzg.com.
60 PTR postfix.com.
53 PTR mail.zzg.com.
60 PTR mail.postfix.com.
vim /etc/resolv.conf
nameserver 192.168.0.53
nameserver 192.168.0.60
测试
nslookup
nslookup 192.168.0.53
阅读(1410) | 评论(0) | 转发(0) |