为了把这台机子配置成真正意义上的mail服务器,我决定把hostname改成mail.example.org vim /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.87.128 mail.example.org mail vim /etc/sysconf/network NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.example.org 1,安装软件包 [iyunv@centos ~]# yum install -y bind-devel bind-chroot bind caching-nameserver 由于dns安装在chroot模式下,所以他的家目录在/var/named/chroot/ [iyunv@centos ~]# cd /var/named/chroot/
[iyunv@centos chroot]# ls
dev etc var 2,dns的配置 [iyunv@mail ~]# cp /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.conf [iyunv@mail ~]# vim /var/named/chroot/etc/named.rfc1912.zones
zone "example.org" IN {
type master;
file "example.org";
};
zone "87.168.192.in-addr.arpa" IN {
type master;
file "87.168.192.in-addr.arpa";
allow-update { none; };
};
[iyunv@mail ~]# vim /var/named/chroot/var/named/example.org
$TTL 86400
@ IN SOA example.org. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS mail.example.org.
mail IN A 192.168.87.128
example.org. IN MX 10 mail.example.org.
[iyunv@mail ~]# vim /var/named/chroot/var/named/87.168.192.in-addr.arpa
$TTL 86400
@ IN SOA mail.example.org root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS mail.example.org.
128 IN PTR mail.example.org.
[iyunv@mail ~]# nslookup -type=MX example.org
Server: 192.168.87.128
Address: 192.168.87.128#53
example.org mail exchanger = 10 mail.example.org.
配置成功!!!
|