Passing a name after the hostname keyword updates the persistent hostname that NetworkManager reports to DHCP and mDNS, which is how other machines discover this one. The change is stored in /etc/hostname so it survives reboots. Use hostnamectl set-hostname when you want to control the static, transient, and pretty hostnames separately.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.