Found brillaint solition.
I switched network in HaOS to dhcp mode (automatic).
And configured my dhcp server to export “local” in search domains.
option domain-name "local";
Local domains now works without hacks and without having to fix it after the upgrade!