PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.48k stars 888 forks source link

Behavior of the addLocal command for IPV6 is strange #5354

Closed seitzbg closed 7 years ago

seitzbg commented 7 years ago

Short description

dnsdist doesn't seem to properly parse/error on addLocal IPV6 statements.

Environment

Steps to reproduce

  1. Add configuration directive as listed below
  2. Start dnsdist
  3. Profit

Expected behaviour

dnsdist would start and listen on the ipv6 address provided.

Actual behaviour

dnsdist either failed to start or listened on an incorrect address.

Other information

If you provide a directive like this:

addLocal("2001:19f0:5:2e8:5400:ff:fe1f:ff12:53", true, false)

It produces the following errors

May 29 19:25:54 proxy-nj1dnsdist[19566]: Script starting up!
May 29 19:25:54 proxy-nj1 dnsdist[19566]: Script starting up!
May 29 19:25:54 proxy-nj1 dnsdist[19566]: Configuration '/etc/dnsdist/dnsdist.conf' OK!
May 29 19:25:54 proxy-nj1 dnsdist[19566]: Configuration '/etc/dnsdist/dnsdist.conf' OK!
May 29 19:25:54 proxy-nj1 dnsdist[19567]: Fatal error: Exception thrown by a callback function called by Lua
May 29 19:25:54 proxy-nj1 systemd[1]: dnsdist.service: Main process exited, code=exited, status=1/FAILURE
May 29 19:25:54 proxy-nj1 systemd[1]: Failed to start DNS Loadbalancer.

If you add a shorter directive: addLocal("2001:19f0:5:2e8::5400:53", true, false)

It starts up and listens on:

tcp6 0 0 2001:19f0:5:2e8::540:53 :::* LISTEN 20150/dnsdist

Clearly the proper syntax for IPV6 is:

[ipv6_address]:port, which works as expected.

stbuehler commented 7 years ago

I'm guessing ::5400: vs ::540: is just a typo, and not what really happend, right?

seitzbg commented 7 years ago

no, the listen address was definitely ::540:53, that was from netstat.

stbuehler commented 7 years ago

Ah right. Please use the --wide/-W option with netstat.

seitzbg commented 7 years ago

This has been fixed in master.