spamhaus / rbldnsd

A small and fast DNS daemon especially made to serve DNSBL zones.
https://rbldnsd.io/
GNU General Public License v2.0
57 stars 12 forks source link

bind failure with "localhost" #20

Closed orlitzky closed 3 years ago

orlitzky commented 4 years ago

After a routine upgrade (kernel 5.4.48, sys-libs/glibc-2.30) rbldnsd started to fail yesterday when launched with -b localhost:

Jul 24 07:20:33 [rbldnsd] listening on 127.0.0.1/53
Jul 24 07:20:33 [rbldnsd] unable to bind to 127.0.0.1/53: Address already in use

If, however, I launch it with -b 127.0.0.1, then everything is fine. This has to do with the entries in /etc/hosts,

# IPv4 and IPv6 localhost aliases
127.0.0.1   localhost
::1     localhost

since I've built rbldnsd without ipv6 support. Commenting out the ipv6 entry in /etc/hosts resolves the issue.. but maybe there is some way to keep rbldnsd from trying to do whatever it's trying to do in this case? Just as a user-interface improvement (note that the error message I received is a non-sequitur).

ammammita commented 3 years ago

Hello,

sorry for the delay. I cannot reproduce the issue on a debian buster with 4.19.

This issue seems probably linked to glibc. Note that the manual says: Additionally, if there are several addresses listed for a hostname, rbldnsd will listen on all of them.. Given the semantics of the -b flag, this behaviour may look like it's expected so i won't touch it in order not to create any regression for other users.

Maybe you could be more explicit regarding how to reproduce, the exact configure command line you're using and the linux distro you were using.

dennywatson commented 3 years ago

At first glance this appears to be a gethostbyname(3) related issue, and not an issue for rbldnsd. I would suggest documentation.

orlitzky commented 3 years ago

Oh, goddamnit =)

I already fixed this in a previous pull request (see the NEWS file) that updates the test suite, but the fixed version hasn't been released yet. I used to include that patch in Gentoo, but I dropped it because the test suite now requires python-2.7 and we no longer support python-2.x. So, I inadvertently dropped my own patch that fixes my own issue. Nice.

orlitzky commented 3 years ago

NOTHING TO SEE HERE