If you have myhostname set for hosts in /etc/nsswitch.conf it shall take care of this for you (should be the default on most systemd distros I believe? not sure)
Mentioning since you say you don’t like ugly, I use Pano (on Gnome 49/Fedora 43) and have no issues with Kate (current version from Flathub) and it looks pretty (imo) as it does little thumbnails for everything. Although I’ve been meaning to try Copyous as it has that + at pointer paste.
If you have myhostname set for hosts in /etc/nsswitch.conf it shall take care of this for you (should be the default on most systemd distros I believe? not sure)