Computer Name change

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
biggocharley

Computer Name change

Post by biggocharley »

I have two machines on my network with the same name. How do I change one of these?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
GeneC

Re: Computer Name change

Post by GeneC »

run this command

Code: Select all

gksudo gedit /etc/hostname
change name, save, exit :wink:
biggocharley

Re: Computer Name change [SOLVED]

Post by biggocharley »

GeneC wrote:run this command

Code: Select all

gksudo gedit /etc/hostname
change name, save, exit :wink:
Thank you --how simple can it get? :lol:
petersk

Re: Computer Name change

Post by petersk »

you likely have to change your /etc/hosts file to make sure the localhost has the 'right' name as well. I think there must be something else to change too.
Kurt
Angtagapagligt

Re: Computer Name change

Post by Angtagapagligt »

petersk wrote:you likely have to change your /etc/hosts file to make sure the localhost has the 'right' name as well. I think there must be something else to change too.
Kurt
I think the hosts file is changed automatically.

But to make it safe open a terminal and type

Code: Select all

cat /etc/hosts
and post the result here.

Angtagapagligt
Karsten

Re: Computer Name change

Post by Karsten »

I think there is a also a safe(r) way for this, at least for Mint 13 / Mate (I translate the names from german to english):
Goto Control center / Network and select the second tab "General" ("Allgemein")
Click the padlock to unlock the settings (admin's password required)
Change the computer name ("Rechnername") and close the dialog.

Mint automatically updates the above mentioned files /etc/hostname and /etc/hosts for you.

Hope this is more comfortable this way,
Karsten
BuckSkin

Re: Computer Name change

Post by BuckSkin »

GeneC wrote: Sun Mar 11, 2012 2:32 pm run this command

Code: Select all

gksudo gedit /etc/hostname
change name, save, exit :wink:
In Linux Mint 19 Cinnamon, when I copy/paste that command, it tells me that "gksudo" does not exist.
Has something about this changed in Mint 19 ?

Thanks.

EDIT 1: Okay...., I replaced gedit with xed and the text editor popped up with the computer name; I changed it and save.
Now, when I open a terminal, my old name remains; however, when I run the /etc/hostname command again, it displays the new name.

EDIT 2: This is a dual-boot machine; can/should Windows and Mint have different names ?
puddleglum
Level 1
Level 1
Posts: 41
Joined: Fri Dec 22, 2017 12:03 pm

Re: Computer Name change

Post by puddleglum »

I think in Mint 19 you have to use:

Code: Select all

xed admin:///etc/hostname
if gksudo does not exist.
gm10

Re: Computer Name change

Post by gm10 »

BuckSkin wrote: Thu Jan 17, 2019 4:57 pm Has something about this changed in Mint 19 ?
You mean if something has changed in the over 6 years that this thread has been dead? Good lord, man...

The correct way to change the hostname these days is this:

Code: Select all

hostnamectl set-hostname YOURNEWNAME
BuckSkin

Re: Computer Name change

Post by BuckSkin »

Thanks for the current commands to accomplish this.

As for the ancient thread, since the information is no longer relevant, it should be purged from the system so that it would not show up at the top of the list in searches regarding the topic as it only serves to mislead poor misguided souls such as I.
gm10

Re: Computer Name change

Post by gm10 »

BuckSkin wrote: Fri Jan 18, 2019 3:01 pmThanks for the current commands to accomplish this.

As for the ancient thread, since the information is no longer relevant, it should be purged from the system so that it would not show up at the top of the list in searches regarding the topic as it only serves to mislead poor misguided souls such as I.
You are welcome. That aside, good luck convincing the volunteer moderators to spend their time verifying 6-year old threads. :lol: Just look at the date, that's why it gets printed on every post. Old information can remain relevant, but in particular where system files are involved never use it blindly.
Locked

Return to “Networking”