免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: arone
打印 上一主题 下一主题

[Mail] MX记录的优先级问题 [复制链接]

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
11 [报告]
发表于 2006-01-02 13:24 |只看该作者
原帖由 r2007 于 2006-1-2 12:30 发表
UDP的是不是有512字节的限制,我是外行,没有发言权。我之所以猜测是这个原因,是根据下面的测试
默认的查询
; <<>> DiG 9.2.2 <<>> hotmail.com mx
;; global options:  pri ...


r0007 是好學及實踐的人,
在 RFC 1035 中 (和 1034 合稱 DNS 最重要的基礎)

  1. 2.3.4. Size limits

  2. Various objects and parameters in the DNS have size limits.  They are
  3. listed below.  Some could be easily changed, others are more
  4. fundamental.
  5. labels          63 octets or less
  6. names           255 octets or less
  7. TTL             positive values of a signed 32 bit number.
  8. UDP messages    512 octets or less
复制代码

lables 就是 hotmail  (lable) , 或 com (lable)
names 就是 hotmail.com
ttl  是cache 時間
udp messages 就是我們兩個討論的問題所在,
這個 udp 512 上限原因即在於此,這是用 dns 做 load balance 不能不注意的地方,
而這個東西在限制在 dns 通常稱為 "basic query" , 因為當年 (你可以看看 RFC 右上角的年份
這個年份我才初一)
並沒有考慮到這麼多,且以當年看 udp 512 巳經算是有一定的 size 了

不過隨著演進,終於證明在 DNS 新的應用上, udp 512 是不夠的,
而為應付 basic query 的不足,所以有了 edns 的提出 (RFC 2671)
不過這是題外話了,感佩 r20007 的經神,特此告知

mx 的選擇問題看來還是沒有人了解或一知半解 ...

[ 本帖最后由 abel 于 2006-1-2 13:26 编辑 ]

论坛徽章:
7
荣誉版主
日期:2011-11-23 16:44:17子鼠
日期:2014-07-24 15:38:07狮子座
日期:2014-07-24 11:00:54巨蟹座
日期:2014-07-21 19:03:10双子座
日期:2014-05-22 12:00:09卯兔
日期:2014-05-08 19:43:17卯兔
日期:2014-08-22 13:39:09
12 [报告]
发表于 2006-01-02 14:03 |只看该作者
长知识了
加问一句,假如我们进入了ipv6时代,那么这个限制(512)就会显得更加突出了,不知道(RFC 2671)是否能够彻底解决这个问题(刚知道有这个rfc,还没读,所以趁热再问一下),并成为Standard?
关于为何有mx值相同的记录,MTA是如何处理的?
试答一下(不怕笑话,欢迎拍砖)
记忆有点模糊,应该是在postfix文档中看到的,大体是这样描述的:具有相同MX值的记录,MTA任取一个,但要保证有一种机制使这些相同值的MX记录能够轮循使用。或由DNS实现,或由MTA实现。

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
13 [报告]
发表于 2006-01-02 14:21 |只看该作者
原帖由 r2007 于 2006-1-2 14:03 发表
长知识了
加问一句,假如我们进入了ipv6时代,那么这个限制(512)就会显得更加突出了,不知道(RFC 2671)是否能够彻底解决这个问题(刚知道有这个rfc,还没读,所以趁热再问一下),并成为Standard?
关于 ...

是的 , ipv6 可能對 DNS payload size 會造成壓力, 至於 edns 是否能完全解決這個問題,在技術面是沒有問題
的,不過好的技術不見得被人使用,所以至於未來實情如何,恐怕只有天知道了,不過可以肯定的是像 dns 的 naptr
記錄 (RFC 2916) 更是龐大,而就 ietf 的 working group 都是建議要使用 edns , 而不使用 dns trancated
狀態

mx 問題您回答的好 ! 做學問就是要到深處去,一理通則萬理通 ! hotmail 皆為同一級別 mx , 所以 mx1-4 中是
ramdom 的,而每次 ramdom 到 mx1(or mx2/3/4) 時,再取四個 IP 中之一,所以輪詢結果為
mx1-1
mx2-1
mx3-1
mx4-1
mx1-2
mx2-2
....

如果其 mx1 若為 5 個 ip , 那 mx1 中任一 IP 要被選到的機率就只有 5% (100/4=25,25/5=5), 而其他
(mx2~mx4, per mx 4ip) 的每部機率則各為 6.25% (100/4=25, 25/4=6.25)

postfix 這樣做, sendmail 也是這樣做的 ! 至於其他的 MTA 就不知了,如果不是這樣做恐怕和
DNS 的概念是稍有不同的 !

[ 本帖最后由 abel 于 2006-1-2 14:24 编辑 ]

论坛徽章:
0
14 [报告]
发表于 2006-01-02 22:48 |只看该作者

回复 13楼 abel 的帖子

just piont out a spelling mistake.hehe
random?

when the preference value is the equal,The records are given out in round robin order, by default,as abel said
All modern name servers give out resource records in round robin order by default.

"DNS and BIND cookbook"
3.19.3 Discussion
BIND 9 doesn't support true round robin, in which the name server tracks the order in which it gives out the records in an answer. Instead, it randomly chooses a starting point in the list of records and then places the remaining records into the response as though the first record had rotated to the beginning. For example, say www.foo.example had the following three A records:

www.foo.example.    IN    A    10.0.0.1
                    IN    A    10.0.0.2
                    IN    A    10.0.0.3
A BIND 9 name server might choose the third A record as the starting point, and then would insert the next two A records (10.0.0.3 maybe this is 10.0.0.2,I only copy and paste and 10.0.0.1) to produce a response in the following order:

www.foo.example.    IN    A    10.0.0.3
                    IN    A    10.0.0.1
                    IN    A    10.0.0.2


I got a question.from above information,It looks like that not MTA choose the order,
but DNS server make the order,and send it to the MTA

[ 本帖最后由 tanyear 于 2006-1-3 08:19 编辑 ]

论坛徽章:
7
荣誉版主
日期:2011-11-23 16:44:17子鼠
日期:2014-07-24 15:38:07狮子座
日期:2014-07-24 11:00:54巨蟹座
日期:2014-07-21 19:03:10双子座
日期:2014-05-22 12:00:09卯兔
日期:2014-05-08 19:43:17卯兔
日期:2014-08-22 13:39:09
15 [报告]
发表于 2006-01-02 23:29 |只看该作者
这个文档的阐述感觉很有道理,楼上可以参考一下
http://www.barracudanetworks.com ... _Load_Balancing.pdf

论坛徽章:
7
荣誉版主
日期:2011-11-23 16:44:17子鼠
日期:2014-07-24 15:38:07狮子座
日期:2014-07-24 11:00:54巨蟹座
日期:2014-07-21 19:03:10双子座
日期:2014-05-22 12:00:09卯兔
日期:2014-05-08 19:43:17卯兔
日期:2014-08-22 13:39:09
16 [报告]
发表于 2006-01-02 23:39 |只看该作者
原帖由 abel 于 2005-12-31 15:34 发表
即使此時回應 4xx 暫時性的問題(try later,temp fail,rate limits,load average issue...),
都不會改選下一個 mx ,而 5xx 的失敗,更是直接說明失敗,這封發信端就不會
再試了(4xx 會再試)


http://www.postfix.org/postconf.5.html
中提到这样两个参数,看来postfix的最新版本已经注意到了这个问题。

smtp_skip_4xx_greeting (default: yes)

    Skip SMTP servers that greet with a 4XX status code (go away, try again later).

    By default, Postfix moves on the next mail exchanger. Specify "smtp_skip_4xx_greeting = no" if Postfix should defer delivery immediately.

    This feature is available in Postfix 2.0 and earlier. Later Postfix versions always skip SMTP servers that greet with a 4XX status code.
smtp_skip_5xx_greeting (default: yes)

    Skip SMTP servers that greet with a 5XX status code (go away, do not try again later).

    By default, the Postfix SMTP client moves on the next mail exchanger. Specify "smtp_skip_5xx_greeting = no" if Postfix should bounce the mail immediately. The default setting is incorrect, but it is what a lot of people expect to happen.

论坛徽章:
0
17 [报告]
发表于 2006-01-03 08:16 |只看该作者
原帖由 r2007 于 2006-1-2 23:29 发表
这个文档的阐述感觉很有道理,楼上可以参考一下
http://www.barracudanetworks.com ... _Load_Balancing.pdf


the paper is useful!

It seems both DNS server and MTA will choose the order by 'random',if the preference value is equal.the latter is better,because DNS server never consider the load balance(It's not his job).

and It depends on DNS server if there is one domain name with many multiple  record.

[ 本帖最后由 tanyear 于 2006-1-3 08:33 编辑 ]

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
18 [报告]
发表于 2006-01-03 13:59 |只看该作者
r2007 真是棒 !
我個人沒有用過 postfix 的,而只是根據 DNS 的經驗及對 sendmail 的經驗來說明這樣的狀況,
只要懂原理,用什麼 MTA 是無所謂的,與您這樣的人討論是愉快的事情 ~

另外想請教 r2007 兄二個主題外問題:
1. postfix 在 relay 時,若同一封信外寄有 1000 個人, postfix 是如何處理的 ?
2. postfix 在 relay 時,若外寄有 user1@domain1 user2@domain1 user3@domain1 user4@domain2 user5@domain2 , postfix 實寄封是幾封(5個收件人,二個 Domain) ?

论坛徽章:
0
19 [报告]
发表于 2006-01-03 16:47 |只看该作者
真是精华。

论坛徽章:
7
荣誉版主
日期:2011-11-23 16:44:17子鼠
日期:2014-07-24 15:38:07狮子座
日期:2014-07-24 11:00:54巨蟹座
日期:2014-07-21 19:03:10双子座
日期:2014-05-22 12:00:09卯兔
日期:2014-05-08 19:43:17卯兔
日期:2014-08-22 13:39:09
20 [报告]
发表于 2006-01-03 18:07 |只看该作者

回复 18楼 abel 的帖子

postfix 在 relay 時,若同一封信外寄有 1000 個人, postfix 是如何處理的 ?
值得探讨的问题,从文档的字面意义上看,postfix的处理过程是这样的:
对一个multiple recipients message,首先把收件人按不同的domain进行分组,如果同一domain的收件人数量超过最大值(具体参数名忘记了,如果此值设为1,那么就成了每一个收件人一组),就按最大值再次划分成若干组。寄信时每组一次会话,也就是每组一个信封,每封信内装相同的message。就知道这么多了。
但是又加问一个:当其中有一个收件人地址无法投递时,接收端会如何回应,发送端会如何处理,sender会得到什么样的反馈消息?postfix如何处理,其它MTA又是如何处理的呢?

BTW:我正在维护的是一个qmail服务器,目前正在考量postfix的功能,准备不久转到postfix,所以没有实际系统进行测试,希望明白的朋友能给个提示或答案。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP