I stopped editing hostname files by hand because one command covers the lot.
sudo hostnamectl set-hostname nas01
hostnamectl
set-hostname writes /etc/hostname and changes the running hostname, so no reboot is needed. hostnamectl then shows the static hostname, machine ID, kernel and virtualization type. It does not touch /etc/hosts. If that file still maps 127.0.1.1 to the old name, update it yourself, or sudo may print a warning that it cannot resolve the new host.
Further reading: hostnamectl manual page