Bingo - that's exactly what I'd hope for. The default default could be /etc/resolv.conf's nameservers (or eg; chroot context's equivalent),
I grok that the runtime is different than parsetime, which makes parsetime the right time to get at the system's info as default. Dunno if there are any system/resolver calls that could be exploited that report the default nameservers (looked a bit, didn't find) to save parsing or possible resolvconf/... complexities - what the system "knows" (and will tell) is handiest. My preference is to use the stock init file, and have other machinery for auto- tweaking/configuring, so sensible inherent default cfg mechanisms rock. World class system software - thanks, and thanks, and thanks again ! On Tue, Apr 18, 2017 at 1:03 AM, Baptiste <[email protected]> wrote: > > > On Fri, Apr 14, 2017 at 4:58 PM, Jim Freeman <[email protected]> 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

