邮件服务器 25
邮件服务器:DNS提供邮箱域名解析——》postfix提供邮件服务
邮件服务器(192.168.88.25):
[root@email ~]# getenforce
Disabled
[root@email ~]# rpm -q firewalld
package firewalld is not installed
# named.service(53)
[root@email ~]# yum install -y bind bind-chroot
[root@email ~]# cat -n /etc/named.conf
1 // named.conf
2 // See /usr/share/doc/bind*/sample/ for example named configuration files.
3
4 options {
5 directory "/var/named";
6 };
7
8 zone "example.com" IN {
9 type master;
10 file "example.com.zone";
11 };
[root@email ~]# ll /var/named/named.localhost # 注意:用户named必须对地址库文件有r权限
-rw-r----- 1 root named 194 11月 6 23:27 /var/named/named.localhost
[root@email ~]# cp -a /var/named/{named.localhost,example.com.zone}
[root@email ~]# cat /var/named/example.com.zone
1 $TTL 1D
2 @ IN SOA @ rname.invalid. (
3 0 ; serial
4 1D ; refresh
5 1H ; retry
6 1W ; expire
7 3H ) ; minimum
8 NS server
9 MX 10 mail
10 server A 192.168.88.25
11 mail A 192.168.88.25
[root@email ~]# systemctl enable named.service --now
[root@email ~]# ss -ntulp | grep :53 # 返回DNS服务
# 测试
[root@client ~]# echo 'nameserver 192.168.88.25' > /etc/resolv.conf
[root@client ~]# yum install -y bind-utils
[root@client ~]# nslookup mail.example.com
Server: 192.168.88.25
Address: 192.168.88.25#53
Name: mail.example.com
Address: 192.168.88.25
[root@client ~]# host example.com
example.com mail is handled by 10 mail.example.com.
[root@client ~]# host mail.example.com
mail.example.com has address 192.168.88.25
# postfix.service(25)
[root@email ~]# yum install -y postfix
117 #myorigin = $myhostname
118 myorigin = example.com # 为邮箱后缀example.com的发件人提供邮件服务。本机使用邮件服务时,省略邮件域名后缀默认为example.com
132 inet_interfaces = all # 允许所有人使用本服务
133 #inet_interfaces = $myhostname
134 #inet_interfaces = $myhostname, localhost
135 #inet_interfaces = localhost
183 mydestination = example.com # 为邮箱后缀example.com的收件人提供邮件服务
[root@email ~]# systemctl enable postfix.service --now
[root@email ~]# ss -ntulp | grep :25
tcp LISTEN 0 100 0.0.0.0:25 0.0.0.0:* users:(("master",pid=4523,fd=16))
tcp LISTEN 0 100 [::]:25 [::]:* users:(("master",pid=4523,fd=17))