6

I use vmware and install ubuntu 12.10 as my guest OS. and run my pc , my network interface is a wireless card however everytime when i try to sudo , i should wait for a long time. and echo

sudo: unable to resolve host ServerName pocUbuntu
[sudo] password for poc: 

I search almost solutions by google , there is no solution can fix my problem.

when i type hostname

root@ServerName pocUbuntu:/home/poc# hostname
ServerName pocUbuntu

and there is my hosts file

 cat /etc/hosts
127.0.0.1   localhost pocUbuntu
127.0.0.1   pocUbuntu
127.0.1.1   pocUbuntu

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

and i can get the ack when ping the servername pocUbuntu

root@ServerName pocUbuntu:/home/poc# ping pocUbuntu
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.030 ms
64 bytes from localhost (127.0.0.1): icmp_req=2 ttl=64 time=0.026 ms

how should i do ? to fix the annoying problem.

newBike
  • 14,385
  • 29
  • 109
  • 192
  • Maybe a link where such questions have to be asked would be helpful – gorn Feb 20 '15 at 21:39
  • You computer name is ServerName, you've changed your computer'name. Here may be a bug, computer's name changed, while the hosts file not changed. You can just change you old computer'name to new one or just add a new item in the hosts file with `127.0.1.1 ServerName` – LF00 Nov 06 '17 at 16:10

1 Answers1

6

try this: /etc/hosts

127.0.0.1 localhost
127.0.1.1 hostname:localdomain hostname

or:

127.0.0.1 localhost
Exceptyon
  • 1,584
  • 16
  • 23