Results 1 to 4 of 4

Thread: How to change hostname from `localhost.localdomain` to something else?

  1. #1

    Question How to change hostname from `localhost.localdomain` to something else?

    I using started working on React apps. When I try and start `npm start` it tries to run on `localhost.localdomain:3000`. `node` gets the name from `process.env.HOST`. I want to change the `hostname`. How do I do it? (I guess I can simply change the configuration files for the React apps but I have to do it for every app.)

    What I tried:

    ```
    > sudo hostname pc0

    > hostnamectl
    Static hostname: n/a
    Transient hostname: pc0
    ```

    Still node tries to start the server on `localhost.localdomain:3000` instead of desired 'pc0:3000'.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    30,927

    Default Re: How to change hostname from `localhost.localdomain` to something else?

    YaST > System > Network settings. There is a tab there to set the hostname.
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    East of Podunk
    Posts
    33,243
    Blog Entries
    15

    Default Re: How to change hostname from `localhost.localdomain` to something else?

    Quote Originally Posted by hcvv View Post
    YaST > System > Network settings. There is a tab there to set the hostname.
    Hi
    Or `hostnamectl set-hostname pc0`
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4

    Default Re: How to change hostname from `localhost.localdomain` to something else?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Or `hostnamectl set-hostname pc0`

    This worked. Thank you!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •