...
Linux
In most Linux distros including CentOS and Ubuntu, the hosts file can be edited directly in the terminal using Vim, Nano, or your favorite text editor. Please note that in order to edit the hosts file you need to open it as root. For example:
...