# This file is automatically generated and any changes
# will be overwritten. DO NOT EDIT!
So if you edit it despite the warning then any update on the WUI DNS server page will overwrite anything that you have added. Also any update of unbound will also cause the hosts.conf file to be renewed.
Since the hosts.conf was placed in /etc/unbound/local.d/ it should be safe from an update.
I would suggest calling is something like: /etc/unbound/local.d/mxrecord.conf
or /etc/unbound/local.d/mailserver.conf
or something different from hosts.conf (just to help with confusion).