[Dnsmasq-discuss] Extend server to accept hostnames for upstream resolver
Geert Stappers
stappers at stappers.nl
Mon Apr 4 13:34:47 UTC 2022
On Sat, Apr 02, 2022 at 09:40:15PM +0200, Dominik Derigs wrote:
> Dear Simon,
Dear Mailinglist audience,
(both the direct readers and the archive vistors)
> In docker swarm and compose configurations, other containers are
> only reachable via hostnames. It is not always possible to assign
> IP addresses beforehand. Hence, the upstream server IP is not
> known at dnsmasq start when the upstream is part of the deployed
> configuration, e.g., a local cloudflared or unbound container.
> ...
> I know my proposal does sound somewhat strange (resolving a DNS
> server name)
I appriciate there is a patch. ( Lets move beyond "strange" )
...
> --- a/src/option.c
> +++ b/src/option.c
> @@ -19,6 +19,10 @@
> #include "dnsmasq.h"
> #include <setjmp.h>
>
> +#ifdef HAVE_RESOLVESERVER
> +#include <netdb.h>
> +#endif
> +
> static volatile int mem_recover = 0;
> static jmp_buf mem_jmp;
> static int one_file(char *file, int hard_opt);
> @@ -846,6 +850,11 @@ char *parse_server(char *arg, union mysockaddr *addr, union mysockaddr *source_a
> char *interface_opt = NULL;
> int scope_index = 0;
> char *scope_id;
> + int addr_type = 0;
> +#ifdef HAVE_RESOLVESERVER
> + int ecode = 0;
> + struct addrinfo *hostinfo, hints = { 0 };
> +#endif
>
As long time direct reader of the mailinglist,
can I tell that the ML archive has entries
where dnsmasq projectleader Simon Kelley
says he is NOT happy with more '#ifdef's.
Groeten
Geert Stappers
--
Silence is hard to parse
More information about the Dnsmasq-discuss
mailing list