matrix:
- configure_args=''
- configure_args='' PGVERSION=9.5
- - configure_args='--disable-evdns --without-cares --without-udns'
- - configure_args='--enable-evdns --without-cares --without-udns'
- - configure_args='--disable-evdns --with-cares --without-udns'
- - configure_args='--disable-evdns --without-cares --with-udns'
+ - configure_args='--with-cares'
+ - configure_args='--with-udns'
+ - configure_args='--disable-evdns'
- configure_args='--with-pam'
- configure_args='--with-openssl'
- configure_args='--without-openssl'
DNS lookup support
------------------
-Starting from PgBouncer 1.4, it does hostname lookups at connect
-time instead just once at config load time. This requires proper
-async DNS implementation. Following list shows supported backends
-and their probing order:
+PgBouncer does host name lookups at connect time instead of just once
+at configuration load time. This requires an asynchronous DNS
+implementation. The following table shows supported backends and
+their probing order:
| backend | parallel | EDNS0 (1) | /etc/hosts | SOA lookup (2) | note |
|----------------------------|----------|-----------|------------|----------------|---------------------------------------|
-| c-ares | yes | yes | yes | yes | ipv6+CNAME buggy in <=1.10 |
-| udns | yes | yes | no | yes | ipv4-only |
+| c-ares | yes | yes | yes | yes | IPv6+CNAME buggy in <=1.10 |
+| udns | yes | yes | no | yes | IPv4 only |
| evdns, libevent 2.x | yes | no | yes | no | does not check /etc/hosts updates |
-| getaddrinfo_a, glibc 2.9+ | yes | yes (3) | yes | no | N/A on non-linux |
+| getaddrinfo_a, glibc 2.9+ | yes | yes (3) | yes | no | N/A on non-glibc |
| getaddrinfo, libc | no | yes (3) | yes | no | N/A on Windows, requires pthreads |
-1. EDNS0 is required to have more than 8 addresses behind one hostname.
-2. SOA lookup is needed to re-check hostnames on zone serial change
-3. To enable EDNS0, add `options edns0` to /etc/resolv.conf
+1. EDNS0 is required to have more than 8 addresses behind one host name.
+2. SOA lookup is needed to re-check host names on zone serial change.
+3. To enable EDNS0, add `options edns0` to `/etc/resolv.conf`.
-`./configure` also has flags `--enable-evdns` and `--disable-evdns` which
-turn off automatic probing and force use of either `evdns` or `getaddrinfo_a()`.
+c-ares is the most fully-featured implementation and is recommended
+for most uses and binary packaging (if a sufficiently new version is
+available). libevent's built-in evdns is also suitable for many uses,
+with the listed restrictions. The other backends are mostly legacy
+options at this point and don't receive much testing anymore.
+
+By default, c-ares is used if it can be found. Its use can be forced
+with `configure --with-cares` or disabled with `--without-cares`. If
+c-ares is not used (not found or disabled), then specify `--with-udns`
+to pick udns, else libevent is used. Specify `--disable-evdns` to
+disable the use of libevent's evdns and fall back to a libc-based
+implementation.
PAM authorization
-----------------
Building on Windows
-------------------
-At the moment, the only build environment tested is MinGW/MSYS.
-Cygwin and Visual $ANYTHING are untested. Libevent 2.x is required
-for DNS hostname lookup.
+The only supported build environment on Windows is MinGW. Cygwin and
+Visual $ANYTHING are not supported.
To build on MinGW, do the usual:
##
# make sure all vars are set
-use_cares=auto
+use_cares=no
use_udns=no
-use_evdns=yes
+use_evdns=no
dnl Find c-ares
AC_MSG_CHECKING([whether to use c-ares for DNS lookups])
CARES_CFLAGS="-I$withval/include"
CARES_LIBS="-L$withval/lib -lcares"
fi
- ], [])
+ ], [use_cares=auto])
AC_MSG_RESULT([$use_cares])
if test "$use_cares" = "auto"; then
AC_CHECK_FUNCS(ares_parse_soa_reply)
LIBS="$tmp_LIBS"
CFLAGS="$tmp_CFLAGS"
-else
+
+else # !cares
dnl Find libudns
AC_MSG_CHECKING([whether to use libudns])
else # !udns
dnl Allow user to override the decision
-AC_ARG_ENABLE(evdns, AC_HELP_STRING([--enable-evdns],[Use libevent for DNS lookups (default on libevent 2.x)]),
- [use_evdns=$enableval])
+AC_ARG_ENABLE(evdns, AC_HELP_STRING([--disable-evdns], [do not use libevent for DNS lookups]),
+ [use_evdns=$enableval], [use_evdns=yes])
AC_MSG_CHECKING([whether to use libevent for DNS lookups])
if test "$use_evdns" = "yes"; then
AC_DEFINE(USE_EVDNS, 1, [Use libevent for DNS lookups.])
}
echo ""
-echo "Results"
-echo " c-ares = $use_cares"
-echo " evdns = $use_evdns"
-echo " udns = $use_udns"
-echo " tls = $tls_support"
-echo " PAM = $pam_support"
+echo "Results:"
+dnl Note: Report here should match selection in src/dnslookup.c
+if test "$use_cares" = "yes"; then
+ echo " adns = c-ares"
+elif test "$use_udns" = "yes"; then
+ echo " adns = udns"
+elif test "$use_evdns" = "yes"; then
+ echo " adns = evdns2"
+elif test "$ac_cv_usual_glibc_gaia" = "yes"; then
+ echo " adns = libc"
+else
+ echo " adns = compat"
+fi
+echo " pam = $pam_support"
+echo " tls = $tls_support"
echo ""