Sunday, March 21, 2010

Hostname in Ubuntu

"ping myhostname" was not working on my Ubuntu machine. I found on the net, for example here that I need to perform the following to get it working:

sudo aptitude install winbind

Then edit /etc/nsswitch.conf by type in "sudo gedit /etc/nsswitch.conf" without the "quote" in the terminal and add wins to the hosts line in the position shown
here:
Code:

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
I did it but the problem did not go away. Later I found elsewhere on the net that /etc/hosts needs an entry 127.0.1.1 myhostname for the name resolution to work.

2 comments:

皇雯 said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.