Exim does not use search domain when connecting to postgres

37 Views Asked by At

Exim does not use "search" domain from /etc/resolv.conf when connecting to postgres specified by short name.

# cat /etc/resolv.conf
search company.com
nameserver 10.20.25.1

# ping postgres
PING postgres.company.com (10.20.25.151) 56(84) bytes of data.
64 bytes from postgres.company.com (10.20.25.151): icmp_seq=1 ttl=64 time=0.140 ms

# exim -be
> ${lookup pgsql {servers=postgres/db/user/password; SELECT 1} {true}{false}}

Failed: lookup of "servers=postgres/db/user/password; SELECT 1" gave DEFER: PGSQL connection failed:
could not translate host name "postgres" to address: Name or service not known

> ${lookup pgsql {servers=postgres.company.com/db/user/password; SELECT 1} {true}{false}}
true

tcpdump shows attempt to resolve full domain name (FQDN):

22:09:47.985371 IP 10.20.25.94.58569 > 10.20.25.1.53: 49358+ A? postgres. (26)
22:09:47.985483 IP 10.20.25.94.58569 > 10.20.25.1.53: 23255+ AAAA? postgres. (26)
22:09:47.985639 IP 10.20.25.1.53 > 10.20.25.94.58569: 49358 NXDomain 0/1/0 (101)
22:09:47.985696 IP 10.20.25.1.53 > 10.20.25.94.58569: 23255 NXDomain 0/1/0 (101)

Does anybody know how to teach exim to use "search" domain ?

0

There are 0 best solutions below