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


How to find hostname of your ubuntu server:

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



Two things to check (assuming your machine is called, 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. localhost.localdomain localhost