On Thu, Jul 13, 2023 at 07:10:29PM -0600, Shawn Heisey wrote:
> On 7/13/23 15:00, Cyril Bonté wrote:
> > Hi Shawn,
> >
> > Le 13/07/2023 à 18:48, Shawn Heisey a écrit :
> >> Looks like on my last edit I deleted it and didn't add it to
> >> defaults, so I was wrong in what I said. It throws a different error
> >> when added to defaults:
> >> Because it should be in the global section, not the defaults one ;)
>
> It didn't work in global either. It threw an error message that I did
> not understand at first.
>
> After a little poking around with google, I added this section to the
> config (with the ipv4 resolver setting in global) and that made it work:
>
> resolvers default
> nameserver dns1 127.0.0.1:53
> nameserver dns2 8.8.8.8:53
> accepted_payload_size 8192 # allow larger DNS payloads
>
> Further investigation revealed that systemd-resolved was not setting
> /etc/resolv.conf to the usual symlink. It was a real zero byte file.
>
> Fixing that so it is a symlink to
> |/run/systemd/resolve/stub-resolv.conf|and commenting the new resolvers
> section in haproxy.cfg has completely fixed the issue.
>
> I didn't think it was a bug in haproxy, but couldn't figure out why it
> was misbehaving. Now I know it was a problem with /etc/resolv.conf. I
> didn't think to look there because I could connect to things by name
> from the shell prompt, so I assumed everything was good.
>
> Thanks,
> Shawn
Indeed, haproxy creates a 'default' resolvers section this way if you
don't create one yourself:
resolvers default
parse-resolv-conf
--
William Lallemand