Tuesday 15 September 2009

can't ping devices by hostname, only IP

I've got a few devices on my home network, including a Maxtor NAS drive. After installing Ubuntu and connecting to the network I found I could ping the IP address of the NAS but not its name.
To resolve devicenames on the network, you need to install winbind via package manager, which adds the winbind service allowing resolution of user and group information from Windows network devices (including my Maxtor NAS drive)

I found this article with a spot of googling, which put me on the right track.
http://forums.whirlpool.net.au/forum-replies-archive.cfm/928521.htm

to install winbind:
> sudo apt-get install winbind

next, you need to add the service to the /etc/nsswitch.conf file:
> sudo gedit /etc/nsswitch.conf

find the hosts line (mine looked like this)
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

and I added wins. Initially I added it at the end, which didn't work.
Then I added it before the [NOTFOUND ] clause. It worked. And also stopped Firefox from accessing external websites...
Finally, this order seems to work:
hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4

...and voila. ping device now works!

References
http://forums.whirlpool.net.au/forum-replies-archive.cfm/928521.htm
http://www.softpanorama.org/Solaris/Reference/etc/nsswitch.shtml

No comments:

Post a Comment