How can I rename my computer? Renaming it in /etc/hosts
and /etc/hostname
does something weird. Before renaming it, I am able to open these files via sublime using
sudo subl /etc/hosts
but when I rename my Computer (using nano) and open any of these files using subl
, I get this message:
No protocol specified
(sublime_text:20071): Gtk-WARNING **: cannot open display: :0.0
So I guess renaming in the above files is not the only thing I have to do.
PS: If I rename using sublime, after renaming one of the files, I get same message when I try to open other file
This sounds like a problem in Sublime Text. You need to change the hostname using:
Then you need to add the new hostname to your
/etc/hosts
file with this command:Find these lines and change the original name to your new hostname:
To save in nano Ctrl+O.
To exit from nano Ctrl+X.
Restart the computer or all services that use the old name.