Table of Contents

Change hostname

A hostname is a label that is assigned to a device connected to a network (Internet, Intranet, Usenet, (W)LAN…) and that is used to identify the device in various forms of electronic communication - via Wikipedia. It's something like “computer name” on Windows.

Default hostname is Cubian, but we can change it:

sudo nano /etc/hostname

Will be opened nano with a simple text file. Clear default content and type own hostname. Avoid using characters other than letters, numbers, and hyphens (-). My hostname is crane-evb-sun4i-linux. Save file, and press Ctrl+Alt+Del to reboot system.

sudo: cannot resolve ...

Usually after this operation, you will get errors cannot resolve hostname-like. Especially, when you are using sudo.

It's caused by incorrect entries in /etc/hosts. Open file as root

sudo nano /etc/hosts

Find line

127.0.0.1   Cubian

and edit Cubian to your hostname. Save file. Fixed! :-)