三、163.com 与sina.com如何通信?
[root@mail ~]# hostname
mail.163.com
[root@mail ~]# dig -t mx sina.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -t mx sina.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 57589
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;sina.com. IN MX
;; Query time: 28 msec
;; SERVER: 192.168.10.99#53(192.168.10.99)
;; WHEN: Sat Aug 4 11:55:05 2012
;; MSG SIZE rcvd: 26
sina.com 找不到!
由于是内部邮件服务器,不是internet 网上的,所以,只能转发:
163.com 和 sina.com 都这样做
[root@mail ~]# vim /var/named/chroot/etc/named.conf
[root@mail ~]# vim /var/named/chroot/etc/named.conf
[root@mail ~]# rndc reload
server reload successful
在163.com 下解析sina.com
[root@mail ~]# hostname
mail.163.com
[root@mail ~]# dig -t mx sina.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -t mx sina.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54345
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; QUESTION SECTION:
;sina.com. IN MX
;; ANSWER SECTION:
sina.com. 86388 IN MX 10 mail.sina.com.
;; AUTHORITY SECTION:
sina.com. 86388 IN NS ns.sina.com.
;; ADDITIONAL SECTION:
mail.sina.com. 86388 IN A 192.168.10.9
ns.sina.com. 86388 IN A 192.168.10.9
;; Query time: 10 msec
;; SERVER: 192.168.10.99#53(192.168.10.99)
;; WHEN: Sat Aug 4 12:11:58 2012
;; MSG SIZE rcvd: 96
发信件,测试:
163.com启动sendmail服务!
[root@mail ~]# service sendmail status
sendmail is stopped
[root@mail ~]# service sendmail start
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
[root@mail ~]# netstat -tupln |grep 25
tcp 0 0 0.0.0.0:25 0.0.0.0:*
[root@mail ~]# tail -f /var/log/maillog //监控日志
Aug 4 12:41:12 mail sendmail[3833]: q744fCNB003833: from=<user1@163.com>, size=1193, class=0, nrcpts=1, msgid=<598984A216F64770B9602B1F6073BCA7@PC201203120919>, proto=SMTP, daemon=MTA, relay=[192.168.10.1]
Aug 4 12:41:52 mail sendmail[3837]: q744fCNB003833: to=<user4@sina.com>, ctladdr=<user1@163.com> (500/500), delay=00:00:40, xdelay=00:00:40, mailer=esmtp, pri=121193, relay=mail.sina.com. [192.168.10.9], dsn=2.0.0, stat=Sent (q744fTsd006212 Message accepted for delivery)
双方已能够正常通信,只是速度太慢
四、163.com 与sina.com通信速度如何加快?
如果163.com 向 sina.com发送信件,sina要对163域名信息进行核实,所以,先正向解析,再反向解析,由于缺少反向解析,所以影响通信质量!
解决:配置反向DNS解析
修改163.com的区域文件:
[root@mail ~]# cd /var/named/chroot/etc/
[root@mail etc]# vim named.rfc1912.zones 增加下面代码
[root@mail named]# cp -p named.local 192.168.10.zone
[root@mail named]# vim 192.168.10.zone
[root@mail named]# rndc reload
server reload successful
[root@mail named]# dig -x 192.168.10.99
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -x 192.168.10.99
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23352
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; QUESTION SECTION:
;99.10.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
99.10.168.192.in-addr.arpa. 86400 IN PTR mail.163.com.
;; AUTHORITY SECTION:
10.168.192.in-addr.arpa. 86400 IN NS localhost.
;; ADDITIONAL SECTION:
localhost. 86400 IN A 127.0.0.1
localhost. 86400 IN AAAA ::1
修改sina.com的区域文件:
[root@mail ~]# cd /var/named/chroot/etc/
[root@mail etc]# vim named.rfc1912.zones
[root@mail etc]# cd ../var/named/
[root@mail named]# cp -p named.local 192.168.10.local
[root@mail named]# vim 192.168.10.local
rndc reload //不用启动,只需加载更新项
[root@mail named]# dig -t mx 163.com //正向解析
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -t mx 163.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14211
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; QUESTION SECTION:
;163.com. IN MX
;; ANSWER SECTION:
163.com. 81604 IN MX 10 mail.163.com.
;; AUTHORITY SECTION:
163.com. 81523 IN NS ns.163.com.
;; ADDITIONAL SECTION:
mail.163.com. 81523 IN A 192.168.10.99
ns.163.com. 81523 IN A 192.168.10.99
;; Query time: 5 msec
;; SERVER: 192.168.10.9#53(192.168.10.9)
;; WHEN: Sat Aug 4 14:01:25 2012
;; MSG SIZE rcvd: 95
[root@mail named]# dig -x 192.168.10.9 // 反向解析
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -x 192.168.10.9
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62534
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; QUESTION SECTION:
;9.10.168.192.in-addr.arpa. IN PTR
;; ANSWER SECTION:
9.10.168.192.in-addr.arpa. 86400 IN PTR mail.sina.com.
;; AUTHORITY SECTION:
10.168.192.in-addr.arpa. 86400 IN NS localhost.
;; ADDITIONAL SECTION:
localhost. 86400 IN A 127.0.0.1
localhost. 86400 IN AAAA ::1
;; Query time: 5 msec
;; SERVER: 192.168.10.9#53(192.168.10.9)
;; WHEN: Sat Aug 4 14:01:28 2012
;; MSG SIZE rcvd: 137
现在反向解析已存在,检测发送------接收信件之间是否加快!
点击发送,发件箱立即空!
接收端能够瞬间接收到信件,达到我们期望的效果啦!