歡迎您光臨本站 註冊首頁

怪異的Sendmail問題, 死活提示 Host name lookup failed.

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

怪異的Sendmail問題, 死活提示 Host name lookup failed.

求助, 我就奇怪了. 我用的是 FreeBSD 6.2 自帶的 Sendmail 套裝, 基本上都是默認配置.
在給 @qq.com 的郵箱發信時, 在 maillog  里均提示如下


Nov 22 20:12:36 d3 sendmail: mAI01Z1N050369: to=<xxx@qq.com>, ctladdr=<nobody@d3.sunbo.com> (65534/65534), delay=4+12:11:01, xdelay=00:00:00, mailer=esmtp, pri=20640663, relay=mx0.qq.com., dsn=4.0.0, stat=Deferred: Name server: mx0.qq.com.: host name lookup failure
Nov 22 20:12:36 d3 sendmail: mAHEbVli040349: to=<xxx@qq.com>, ctladdr=<nobody@d3.sunbo.com> (65534/65534), delay=4+21:35:05, xdelay=00:00:00, mailer=esmtp, pri=22350654, relay=mx0.qq.com., dsn=4.0.0, stat=Deferred: Name server: mx0.qq.com.: host name lookup failure


看上去原因很明顯, sendmail 找到了 qq.com  的 mx 伺服器 mx0.qq.com , 但無法解的域名~~

但是我檢查過伺服器的配置, 也測試過 host/dig/ping 等命令, 伺服器確信絕對可以解析出 mx0.qq.com .

後來查詢了大量的 maillist 資料, 大部分都提到這是由於 sendmail 在支持IPV6的情況下會優先發送查詢 AAAA 記錄, 如果伺服器返回了 SERVFAIL 而非 NODATA 那麼 sendmail 就認為查詢失敗, 但是可以通過在 .mc/.cf 文件里加入以下兩行解決: (我用host -t AAAA mx0.qq.com 確實返回了 ServFail)
define(`confBIND_OPTS', `WorkAroundBrokenAAAA')dnl

# name resolver options
O ResolverOptions=WorkAroundBrokenAAAA

我看了一下默認配置就已經是這樣的了, 可是仍然不行, 我也嘗試過強制將 mx0.qq.com 寫入 /etc/hosts 文件, 甚至還改了 service.switch 文件也不可以.

超級莫明其妙了, 特求幫助, 有沒有人遇到類似的問題呢?
《解決方案》

哎,MS是freebsd本身的DNS解析庫的問題? 在LINUX就沒問題 :(

在 sendmail 文檔中找以以下原話, 可是我試也也沒用, 似乎這個選項根本沒有用.

9.2.7 Broken IPv6 Name Servers
The sendmail program will look up AAAA records only if it is built with the NETINET6 (NET...) compile-time macro defined. As described earlier, sendmail looks up the AAAA records first, then A records.

All name servers should return NODATA if a host is found and no AAAA records are available. But some name servers are broken and, when asked for an AAAA record, will wrongly return a temporary failure (SERVFAIL). This causes sendmail to queue the mail for later delivery.

If you have defined NETINET6 when building sendmail, and if you notice this kind of error, we have two recommendations:

Notify hostmaster at the site that is running the broken name server. The sooner broken name servers are fixed, the cleaner the Internet will run.

Run the whois(1) program to find the email address of the administrator for the site. It should be hostmaster, but often it is not.

Add the WorkAroundBrokenAAAA argument to the ResolverOptions option (ResolverOptions) in your mc configuration file:

define(`confBIND_OPTS', `+WorkAroundBrokenAAAA')
This will cause sendmail to pretend that NODATA was returned when SERVFAIL is wrongly returned. This causes sendmail to continue with further lookups, specifically for A and MX records.

[ 本帖最後由 hightman 於 2008-11-22 22:58 編輯 ]
《解決方案》

最終受不了了,屈服了,我重新編譯sendmail去掉INET6,換得一時可用

[火星人 ] 怪異的Sendmail問題, 死活提示 Host name lookup failed.已經有2232次圍觀

http://coctec.com/docs/service/show-post-26085.html