The World

[as I find it]

Samba as a WINS server in a Windows Peer Network

I’ve spent the last couple of days trying to get a Debian Etch machine running Samba as a fileserver for our local Windows peer network. (Maybe some day I’ll get around to building a domain controller, but it’s not really necessary at the moment.) We’ve needed a simple way to share files, store backups, and run shared version-control repositories for some time now. I am pleased to report that all the information out there, along with some help from O’Reilly’s Linux Cookbook, made this pretty simple.

I’m not going to reiterate all the steps for setting up Samba. Instead, I just wanted to give a tip to anyone who might be looking to set up their own fileserver in a Windows peer network: use Samba as a WINS server if you don’t already have one! This is recommended by the Samba people (see this page) and has made peer-to-peer network access in Windows a lot smoother for me.

WINS is the Windows Internet Name Service, a protocol for resolving NetBIOS names in Windows networks. (These are names you can type into Windows Explorer like “\\my-server”.) Without a WINS server, your Windows clients are going to be broadcasting packets all over the place every time they need to see another computer — for example, if you’re browsing “My Network Places” or workgroup computers. At least in our home network, this results in extremely slow access to machines in the same LAN and really buggy connectivity: sometimes I lose a connection in the middle of transferring a file, or after refreshing my view of a network share, without any explanation.

Configuring Samba to act as a WINS server is really easy. Just add the following parameters to your smb.conf file:

os level = 99
wins support = yes
name resolve order = wins lmhosts hosts bcast
domain master = yes
preferred master = yes

The exact meaning of these settings is described pretty well on the Gentoo wiki.

You’ll also want to assign your fileserver a static IP address in your local network. In Debian, you set this in /etc/network/interfaces, but this varies by GNU/Linux distribution.

Once you add the above configuration parameters and restart Samba, you need to configure all your Windows clients to use the Samba server as a WINS server. This is the one part of the process for which there was not a wealth of documentation out there at the tip of a Google search, so hopefully this will help someone out. On each Windows machine:

  1. Open the Properties dialog for the network interface you use to connect to the LAN. In XP, you can do this by hovering over the “Connect To…” option on the Start menu, right-clicking your interface, and clicking “Properties.”
  2. Select “Internet Protocol (TCP/IP)” from the list of protocols used on that interface and click “Properties.”
  3. Click “Advanced.”
  4. In the resulting “Advanced TCP/IP settings” dialog, select the WINS tab and click “Add…” Enter the IP address of your fileserver. You can probably leave the other settings at their defaults. Click OK on each of the configuration dialogs you have opened.
  5. Open a DOS command window (Start -> Accessories -> Command Prompt) and enter the following three commands:
    ipconfig /release
    ipconfig /renew
    ipconfig /all
    

    The output from the last command should show that your Primary WINS Server has the IP address you entered above. If not, you did something wrong!

If all went well, you should now have a Samba WINS server set up in your Windows peer network. So far, I’ve noticed a fairly dramatic improvement, though I’ll post edits here if I find that any settings need additional tweaking.

Advertisements

Written by whereofwecannotspeak

October 24, 2007 at 4:00 pm

Posted in Free Software

6 Responses

Subscribe to comments with RSS.

  1. you can acchive the same resetting of the config simply by right clicking on the lan icon and choosing “repair”

    Troy

    April 7, 2008 at 8:04 pm

  2. So, can I make this more complicated? We have 2 Samba boxes, one in each WAN location. The conneciton between the 2 is standard (cable), so should each LAN be set to its own WINS as described here or can only 1 be the WINS?

    Thanks from a non-profit “accidental tach” in need of help!

    barbara

    August 12, 2009 at 2:45 am

  3. I’ve been using Samba on a Ubuntu box for quite some time, always suffering the slow response times you describe here. After one of many Ubuntu 9.10 “updates” ( <- read: "Another opportunity to figure out which config file needs to be changed!) Samba stopped working.

    Knowing that it had worked before (albeit with slow response) I decided to try your recommendation here. Whaddya know? Samba's working again!

    ThankyouThankyouThankyouThankyouThankyou!!!!!!

    Your work has made someone out on the 'net (me) a very happy person. Consider your Karma fully charged!

    jas

    JS

    January 28, 2010 at 6:25 pm

  4. Hi, and thanks for this post – I can confirm that Samba as a WINS server is a blessing in a mixed network. It deals very nicely with XP, 7 and Mac OS X in peer-to-peer use.

    Our fileserver is not even linux-based, but I hacked a lacie NAS and made it a WINS server, kind of like a neutral referee in a tough game between the operating systems. It works well this far.

    Cheers,
    Pat

    Patrick

    August 30, 2010 at 5:41 pm

  5. We can just add WINS server on the DHCP configuration by adding:

    option netbios-name-servers ip.of.the.server;

    Agus

    January 17, 2012 at 11:42 pm

  6. Add a DHCP server to your samba system, set the Default gateway and WINS settings so that when a client connects to the DHCP the DHCP will configure the clients for you 🙂

    ron

    September 5, 2014 at 8:11 am


Comments are closed.

%d bloggers like this: