Use `hostname` output for PS1

Currently, on a server called 1.ns.example.com, the prompt only shows

1$

The desired state is

1.ns$

There seems to be no shortcut for either bash/zsh to implement this.
On Linux, we get the expected behaviour when using $(hostname) in PS1,
if hostname and fqdn are correctly set.