在chroot postfix中使用DNS查找

我正在尝试在客户端计算机上设置postfix。 所有机器都应该使用中央ldap目录来进行常见的后缀(例如别名等)。 但是因为在chroot postfix中运行postfix无法解析ldap服务器的主机名。

Postfix mail.log行:

Apr 30 13:37:22 host postfix/cleanup[30160]: dict_ldap_debug: ldap_connect_to_host: TCP ldapmaster.domain.com:389 Apr 30 13:37:22 host postfix/cleanup[30160]: dict_ldap_debug: ldap_connect_to_host: getaddrinfo failed: Name or service not known Apr 30 13:37:22 host postfix/cleanup[30160]: dict_ldap_debug: ldap_err2string Apr 30 13:37:22 host postfix/cleanup[30160]: warning: dict_ldap_lookup: Search error -1: Can't contact LDAP server Apr 30 13:37:22 host postfix/cleanup[30160]: warning: AF28B226A2: sender_canonical_maps map lookup problem for root@domain.com 

当我手动执行ldapsearch时,它工作正常。 我也尝试进入postfix( /var/spool/postfix )的chroot环境,当我尝试ping ldapmaster.domain.com我得到一个unknown host – 错误。

已经向Ubuntu Launchpad报告了该问题,因为在natty升级后,chroot中的DNS主机名查找失败 。

任何想法如何允许postfix解析DNS名称?

我发现libross库似乎是在chroot之后加载的。 所以他们需要在chroot监狱。 链接他们:

 cp -vl /lib/i386-linux-gnu/libnss_* /var/spool/postfix/lib/i386-linux-gnu/ 

不明白为什么postfix不能解析DNS名称,只需将LDAP提供程序的DNS添加到/etc/hosts 。 因此,您可以独立进行任何DNS查找,如果DNS服务器出现故障,请不要陷入困境:

 1.2.3.4 thehostname