Host Names on Ubuntu Server

Fix issue of sudo: unable to resolve host

Probuse Admin

We had issue in ubuntu VPS server when make sudo:

sudo: unable to resolve host sXXX-YY-ZZ-ZZ.secureserver.net

=========================================================

How to find hostname of your ubuntu server:

root@ sXXX-YY-ZZ-ZZ:~# sudo vi /etc/hostname

=========================================================

Solution:

Two things to check (assuming your machine is called sXXX-YY-ZZ-ZZ.secureserver.net, you can change this as appropriate):

That the /etc/hostname file contains just the name of the machine.

That /etc/hosts has an entry for localhost. It should have something like:

  1. 127.0.0.1 localhost.localdomain localhost

  2. 127.0.1.1 sXXX-YY-ZZ-ZZ.secureserver.net