Kresd in 3.5 crashing on too many forward targets

After the 3.5 update, kresd was no longer coming up automatically. It seems that that there is a limit of 4 FORWARD targets hardcoded:

root@turris:# kresd -c /tmp/kresd.config
/usr/lib/kdns_modules/policy.lua:70: at most 4 FORWARD targets are supported

Yet my automatically generated resolver file looks like this:

root@turris:~# cat /tmp/resolv.conf.auto
# Interface wan
nameserver 93.153.117.1
nameserver 93.153.117.33
# Interface wan6
nameserver 2001:1ae8:2:4010::1:1
nameserver 2001:1ae8:2:4060::1:1
# Interface wan_6
nameserver 2001:1ae8:2:4010::1:1
nameserver 2001:1ae8:2:4060::1:1

No idea why the IPv6 interface shows up twice. There’s a sort pipe in /etc/init.d/kresd that I changed to sort -u to remove the double entries, though it’s hardly a good fix.

3 Likes

Kresd was crashing for me too after the 3.5 update.

For some reason, my resolv.conf.auto looks like this:

# Interface wan
nameserver 206.248.154.170
nameserver 206.248.154.22
nameserver 206.248.154.170
nameserver 206.248.154.22
# Interface wan6
nameserver 2607:f2c0::1
nameserver 2607:f2c0::2

Maybe the duplicate nameservers are because I’m using PPPoE with DHCPv6? Regardless of the reason for the duplication, the number of nameservers is > 4, so kresd died for me too.

I went with an even easier (though arguably worse) work-around: I simply disabled forwarding on the DNS router configuration page.

I would certainly appreciate a better fix too.

replace sort by sort -u |head -n4
https://forum.test.turris.cz/t/came-home-from-work-no-longer-have-dns/2973/6

More details behind the scenes you can find here: