Cart

    Sorry, we could not find any results for your search querry.

    Changing your hostname in Debian 11

    It is important to set a correct hostname on your VPS. The hostname is used by many applications to identify themselves on a network / the internet. Therefore, an incorrectly configured hostname can cause unexpected problems.

    In this tutorial we show how you can check and/or change your current hostname in Debian 11.


    Checking the hostname

     

    The current hostname can be retrieved with the command:

    hostname

    Or for more extensive information use the command:

    hostnamectl

    Changing the hostname

     

    There are two recommended methods to customize or view your hostname:

    • thehostnamectl-command
    • thehostname-command

    Only the changes of the first option remain intact after a restart. You change your hostname with these options as follows:
     

    • Hostnamectl:
      Use the command below and replace server.yourdomain.com with your desired hostname:
      hostnamectl set-hostname server.yourdomain.com
      
    • hostname:
      Use the command below and replace server.yourdomain.com with your desired hostname:
      hostname server.yourdomain.com
      Please note that with the hostname command, the changes do not persist after a reboot of your VPS.

    Need help?

    Receive personal support from our supporters

    Contact us