Changing hostname safely

Forum Forums General Software Changing hostname safely

  • This topic has 1 reply, 2 voices, and was last updated Mar 1-1:28 am by Robin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #100812
    Member
    dukester

      I’m trying to setup the nn newsrewder.
      It chokes because my hostname is simply antixbox
      It wants a FQDN hostname.
      I used sudo hostname=antixbox.org
      My hostname got changed for the session, but firefox quit working.
      My terminals quit working. I thought I had hosed the system.

      I went to a virtual terminal, logged in and halted the system.
      My original hostname is back.

      So how do I change the hostname without trashing the system? TIA

      --
      dukester

      #100814
      Member
      Robin
        Helpful
        Up
        0
        ::

        You need to change the hostname in two places in the proper order, otherwise you might easily lock yourself out of the system.

        I did it successfully this way:

        1.) edit the file /etc/hosts using either geany or leafpad.
        ADD the line
        myname 127.0.0.1
        without removing the existing entry:
        antix1 127.0.0.1

        2.) Then REPLACE the very line in the file /etc/hostname
        change from
        antix1
        to
        myname

        3.) Then again edit /etc/hosts and REMOVE now the original line
        antix1 127.0.0.1
        keep the new line
        myname 127.0.0.1

        By all means, observe this procedure strictly in the given order. You need root privileges in order to be able to save the files back to disk after editing.
        And now, with root privileges enter in Terminal (e.g. roxterm):

        hostname -F /etc/hostname

        This procedure will change the hostname of your antiX permanently, and even survive a reboot.
        (On live system you’ll need to perform a live remaster from antiX control center to keep it.)

        ———-
        P.S.: Please keep in mind you NEED to use a valid hostname:

        „The hostname should be composed of up to 64 7-bit ASCII lower-case alphanumeric characters or hyphens forming a valid DNS domain name. It is recommended that this name contains only a single label, i.e. without any dots. Invalid characters will be filtered out in an attempt to make the name valid, but obviously it is recommended to use a valid name and not rely on this filtering.”

        Hostname specification quoted from and further reading at freedesktop.org.

        Windows is like a submarine. Open a window and serious problems will start.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.