On Mon, Apr 2, 2018 at 5:09 PM, Ben Draut <dra...@gmail.com> wrote: > Assuming no one else is already working on the feature, I'd like to > contribute > the change to have the resolvers section fall back to parsing > /etc/resolv.conf > when no nameserver directives are present. > > This was previously discussed here: https://www.mail-archive > .com/haproxy@formilux.org/msg28626.html. > (Jim Freeman and I are colleagues.) > > I've been surveying the code to see how it could be implemented. I think it > would make sense to register a 'post_section_parser' for the resolvers > section > that would add the nameservers from /etc/resolv.conf if no nameservers were > specified in the section. As Jim pointed out previously, libresolv could > be used > to parse the file. If that's undesirable for some reason, we could parse it > ourselves. > > I'm new to the codebase, so I'm open to any suggestions or guidance anyone > may have. > > Thanks, > > Ben > >
Hi Ben, I welcome this feature, though I have a few comments: - I have nothing against libresolv, but I think this function should be implemented natively in HAProxy - (for Lukas) what do you think is better, a configuration option to trigger parsing of resolv.conf or as proposed, if no nameserver are found, we use resolv.conf as a failback? As the maintainer of the DNS code in HAProxy, don't hesitate to ask me any questions. Baptiste