5

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

1 Answer 1

8

This sounds like a problem in Sublime Text. You need to change the hostname using:

sudo hostname your-new-name

Then you need to add the new hostname to your /etc/hosts file with this command:

sudo nano /etc/hosts

Find these lines and change the original name to your new hostname:

127.0.0.1       localhost
127.0.1.1       your-new-name

To save in nano Ctrl+O.
To exit from nano Ctrl+X.

Restart the computer or all services that use the old name.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .