On Fri, Apr 14, 2017 at 4:58 PM, Jim Freeman <sovr...@gmail.com> wrote:

> The "resolvers" section doc discusses default values for all its
> paramaters except "nameservers".
>
> If I have a on-line "resolvers" eg;
>
>   "resolvers default"
>
> with no parameters listed, are the system (or context eg; chroot)
> /etc/resolv.conf nameservers used?  [ this would be a boon to cfg
> automation ]
>
> Thanks,
> ...jfree
>

Hi Jim,

Name resolution performed at runtime is not the same as the one performed
when parsing the configuration file.
At runtime, HAProxy uses the IP addresses provided by the nameserver
directives. At configuration parsing time, HAProxy uses the libc, hence
resolv.conf.
The runtime resolver don't read the resolv.conf file. As a workaround, your
init script may be able to update the cfg file quite easily.

This gave me an idea, since you speak about automation :)
We could improve the "resolvers" section parser with a couple of new
features:
- parsing a 'resolv.conf' file style (you provide a path to the file) to
read the nameserver directives only (for now)
- using environment variables

Baptiste

Reply via email to