Hello everyone,

thanks for all the replies!

When it's not starting is there anything else listening on UDP or TCP port 53? 
No, it's not.

Did you tweak the configuration or is it running on default config? 
My config was:
net = { '127.0.0.1', '::1', <my.lan.ip> }
user('knot-resolver','knot-resolver')
cache.size = 4 * GB
modules = { 'stats' }
verbose(false)

I set up net directive according to:
http://knot-resolver.readthedocs.io/en/stable/daemon.html#network-configuration
I've since removed the net directive since I assumed that with socket activation, it's not necessary to specify addresses within the service but rather within the socket.

FreeBind=true
This one helped, thanks!
I've rebooted a few times and so far kresd started in 100% cases.

Should I also try 'After=network-online.target' instead of FreeBind? And if it helps, which of those two is a more proper way to handling this issue?

Thanks again!

--
Regards,
Thomas Van Nuit

Sent with ProtonMail Secure Email.

-------- Original Message --------
Subject: Re: [knot-dns-users] Knot Resolver autostart on systemd
Local Time: October 7, 2017 9:11 PM
UTC Time: October 7, 2017 7:11 PM
From: andrew@ugh.net.au
To: Thomas Van Nuit <thomasvannuit@protonmail.ch>
knot-dns-users@lists.nic.cz <knot-dns-users@lists.nic.cz>


> On 6. Oct 2017, at 20:21, Thomas Van Nuit <thomasvannuit@protonmail.ch> wrote:
>
> After a few reboots I"ve observed that sometimes the service starts OK, sometimes it fails. Is it possible that there is some sort of race condition?

From memory "Cannot assign requested address” is when you try to bind to an IP that isn’t local - so maybe the race condition is between whatever configures your interfaces and what I starting knot? Presumably there will be a dependency you can declare for knot to make sure that it doesn’t start before interfaces are up.

HTH,

Andrew