mBerube.net
A journey to .Net

Access machine by hostname between Linux and Windows without DNS server

Wednesday, 23 June 2010 12:39 by mBerube
(Also available in: français)

During setup of my Dev server, I found that I was able to access my Linux server by IP but not by name. The same thing was true from Linux to Windows. After a couple searches on the net, I realized that my network wasn't using a DNS server. It means that the name solution was made by another mecanism. In my case, my machine names are resolved using Netbios. So, how to make it works on Linux (specifically Ubuntu but it's pretty much the same for the other distrib I guest) :

  • Install samba (sudo apt-get install samba)
  • Once install, edit /etc/samba/smb.conf and, in the global settings section, set the workgroup and netbios name values to the proper values for your machine.

Your now able to access your Linux box by name from Windows. Now, how to do the other way (from Linux to Windows) :

  • edit /etc/nsswitch.conf and change the line hosts: file dns by hosts: file wins dns (order matters)
  • Finally, install winbind (sudo apt-get install winbind)

After that everything works as expected, from Windows and Linux. I hope it will works for you as well.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Programmer life
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed