MEDIUM: resolvers: create a "default" resolvers section at startup
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 5 May 2022 17:02:59 +0000 (19:02 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 6 May 2022 15:02:15 +0000 (17:02 +0200)
commit7867f633134d92c9b7858f10946fa4f8b4983576
treeac0cb01ef600e72e40bec7c9c9f51c163dd08df8
parent0164a40c59e1c1ceb3661d29cbbe8fb7d988cbc3
MEDIUM: resolvers: create a "default" resolvers section at startup

Try to create a "default" resolvers section at startup, but does not
display any error nor warning. This section is initialized using the
/etc/resolv.conf of the system.

This is opportunistic and with no guarantee that it will work (but it should
on most systems).

This is useful for the httpclient as it allows to use the DNS resolver
without any configuration in most of the cases.

The function is called from the httpclient_pre_check() function to
ensure than we tried to create the section before trying to initiate the
httpclient. But it is also called from the resolvers.c to ensure the
section is created when the httpclient init was disabled.
include/haproxy/resolvers.h
src/http_client.c
src/resolvers.c