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 (4 days ago)
gentoobro
in reply to feld • • •My Name Is Unimportant, And My Accomplishments Are Few
in reply to gentoobro • • •gentoobro
in reply to My Name Is Unimportant, And My Accomplishments Are Few • • •feld
in reply to gentoobro • • •My Name Is Unimportant, And My Accomplishments Are Few
in reply to feld • • •feld
in reply to My Name Is Unimportant, And My Accomplishments Are Few • • •My Name Is Unimportant, And My Accomplishments Are Few
in reply to feld • • •feld
in reply to My Name Is Unimportant, And My Accomplishments Are Few • • •mr64bit
in reply to feld • • •feld
in reply to mr64bit • • •@mr64bit you can even find it in their changelog where they added it and enabled it by default
The only explanation is that someone was like "Why can't I plug my computer into a this cable modem and then plug in something else??" because some ISPs do require a manual release if you're monkeying around like this
Brad
in reply to feld • • •Systemd /networkd does not release DHCP ipaddress / dns after shutdown
dirkpetersen (GitHub)feld
in reply to Brad • • •Kevin P. Fleming
in reply to feld • • •feld
in reply to Kevin P. Fleming • • •@kevin crazy. It's never been default behavior for ISC-DHCP and was never a requirement in the spec.
Some people just try to be clever without understanding the consequences...
Fritz Adalis
in reply to feld • • •@Viss
"Servers should have static addresses"
Although there are times when this would have come in handy for me. Just yesterday, in fact.
feld
in reply to Fritz Adalis • • •@FritzAdalis @Viss but if it's DHCP I can have it automatically handle forward and reverse DNS... if it's a static IP I have to manage those myself... and configuring a static DHCP lease is reasonable sometimes but not for everything you deploy.
Drew Scott Daniels
in reply to feld • • •Thank you for sharing 🙂
focal - prevent networkd from performing a dhcprelease
Ask Ubuntufeld
in reply to Drew Scott Daniels • • •