Paperspace hostnames are auto-generated and dynamically assigned when the instance is provisioned. If you change the hostname of a Linux instance using the standard hostname command, the new hostname will reset if you start/stop or reboot the instance. This guide will enable you to set a static hostname that persists across reboots.
Update the /etc/hosts file on your Linux instance with the new hostname.
sudo vim /etc/hosts
Change the name associated with the IP address 127.0.0.1 to the hostname that you want the instance to use even after a reboot. Typically this involves changing localhost to the new hostname.
Update the /etc/hostname file on your Linux instance with the new hostname.
sudo vim /etc/hostname
If you have not already done so, run the Linux hostname command and specify the new hostname if you want to begin using the new hostname without restarting.
sudo hostname new_hostname
The next time that you restart or reboot the instance, run the Linux hostname command again to verify that the hostname change persisted.
The command should return the new hostname.