systemd's networking added a terrible feature to DHCP in Systemd v244 (2019-11-29):

It sends a RELEASE packet on shutdown.

So if you're restarting a server that uses DHCP and are running something like dnsmasq, it rips the DNS entry out of cache and the TTL is already super low (TTL=1) so now you can't ping the server by its hostname to watch it come online until it's actually back online. If you try too quickly, you'll end up with a negative cache entry which is even stupider.

You can fix this though:

/etc/systemd/networkd.conf


[DHCPv4]SendRelease=false
CriticalConnection=true

Now it doesn't do this batshit insane behavior

This entry was edited (2 months ago)
in reply to feld

@mr64bit This looks like the bug they were trying to fix: github.com/systemd/systemd/iss…
in reply to feld

wow, this was a thing for years and not everyone gets it: askubuntu.com/questions/140096…
Thank you for sharing πŸ™‚
⇧