Home > Networking > How to Determine the Master Browser in a Windows Workgroup

How to Determine the Master Browser in a Windows Workgroup

February 14th, 2009

Home NetworkHere’s a little problem that drove me crazy: How do you determine the Master Browser in a Windows Workgroup?

First of all, lemme explain a bit about how a workgroup works. When you have a LAN set up running Windows machines, each machine can see all the others in Network Neighborhood (or just “Network” in Vista). If you want to see the files on another machine, you just go to Network Neighborhood, click, et voila!

The other method you can use is to open Windows Explorer (keyboard shortcut: Win-E) and in the location/address bar, type:


So, if you want to go to the computer called BALTHAZAR, you’d type:


And hit enter. This is handy to know if Network Neighborhood is not working. And a grumpy Network Neighborhood is exactly the reason why sometimes, you need to find out which computer is the Master Browser.

On a local area network (LAN), each computer “talks” to the others. Each computer has an IP address, like, and also a name. The name is what you call your computer so you and your friends don’t have to remember the IP address. In our example above, the computer name is BALTHAZAR, but the IP address might be Fabulous.

So, what happens is that each computer on the LAN must talk to the others. Since we’re only dealing with a workgroup, and there is no domain server, there is no computer to keep track of what machines are active on the network. This is where the Master Browser schtick comes into play.

What happens is that all the computers on your LAN hold an “election”. This election depends on a number of factors, but for the purposes of this discussion, we just have to know that all the computers get together and vote on who will be the Master Browser on the LAN. Once a computer is elected, it will keep track of what machines are connected to the LAN by more or less sending messages to say, “Yo! You still there?”

Of course, you may ask: What happens when the computer that is the Master Browser gets shut down when, say, I go to bed? In that case, you will find that your Network Neighborhood may not work so well. At that point, all the computers on the LAN get together again and they hold another election. As I understand it, there are one or more “Backup Master Browsers” waiting in the wings, but we’ll ignore that for now.

Now, what happens when you have Network Neighborhood turning up blank on you sporadically, or possibly missing several of the computers on your LAN from time to time? Well, in that case, you need to determine who is the Master Browser so that you can narrow down the problem to one computer and see if maybe you need an updated ethernet driver, or there are firewall problems, or whatever.

The “fun” way of doing this is with DOS commands. Here’s how you’d do it:

  1. Open up a command prompt
  2. Type net view and hit enter
  3. Look at the list of computer names. These are the computers on your LAN. Note that the format is \\COMPUTER-NAME like I talked about above.
  4. For each name in the list, type the following command: nbtstat -a COMPUTER-NAME

One of the results from the nbtstat commands will show a row with “_MSBROWSE_” in it. That means that this computer is the Master Browser.

Wasn’t that fun?

No, it wasn’t.

So, I wrote a little script in Ruby to do this for you. I needed to in order to troubleshoot a networking problem on one machine on my LAN, and I didn’t want to type 10-20 commands every time. But as long as I was writing it, I figured I would jack it up a bit. Here’s what it does:

  • net view net view /domain to determine the list of workgroup names
  • net view /domain:[WORKGROUP] to determine the list of puter names for each [WORKGROUP]
  • extracts the individual computer names and sticks them in an array
  • iterates through the array and calls ping -n 1 -4 COMPUTER-NAME on each computer name (we only want to display IPv4 addresses, hence the “-4″ switch)
  • iterates through the array of IP addresses and calls nbtstat -A IP-ADDRESS (the “-A” means “I’m giving you an IP address instead of a computer name”. This is a more reliable way of doing things.)
  • After each call to nbtstat, it not only checks for the _MSBROWSE_ string, but it also records the MAC address of the network adapter in the remote computer.
  • iterates through all the data and displays a nicely formatted table, like so:
Scanning LAN...

BERT     00-18-C0-42-A3-B2   CHEESE
RHINOX   00-00-00-00-00-00   WORKGROUP   MASTER
Q        00-28-F6-68-F5-48   WORKGROUP
RADDAR   00-02-0D-74-FC-33   CHEESE
MOP      00-1B-8C-56-01-52   CHEESE      MASTER
AI       00-6A-83-6B-A0-83   WORKGROUP

Press any key to exit...

I wrote this little script in Ruby because it was fast and easy. But I didn’t want to have to call it from a command prompt with ruby all the time, and I wanted others to be able to use it without having to install Ruby on their own computers. So, I compiled it into a self-contained executable using RubyScript2Exe, and I added a pretty icon with Resource Hacker. Now my nifty little 2kB script is a lovely 1.5MB executable. Well, ya know… You can’t have everything. It may be bloated, but at least it works!

You can run it from the command line, or from Windows. It’s best to put the file in your Windows directory. It won’t run properly unless it’s on your boot drive (usually C:). If plopped into the Windows directory itself, it will be executable from any drive or directory on your computer. Anyway, if you run it from Windows, it will just open up a command prompt window and pause before closing it so you can see the results. On my machine, it’s nice and speedy.

Oh, and one last note: it might take 30 seconds or so to scan your LAN. The more machines you have, the more work it was to do.

So, now you have a lovely tool to determine the IP address, MAC address, name, and Master Browser status of all the computers on your LAN.

UPDATE (8 June 2009): My little LANscanner program has been updated to version 1.1. It now supports the x64 flavor of Windows XP, Vista, and 7. Be sure to read the included .TXT file for install instructions!

UPDATE (27 February 2010): LANscanner has been updated to version 1.2. New in this release is the display of the workgroup for each computer, as well as formatting improvements that should make the output easier to read even with long computer/workgroup names.

UPDATE (20 March 2010): LANscanner has been updated to version 1.3. This release is mostly a bug fix for 1.2. In the older version, the only workgroup reported was the one your puter was on. Oops! That didn’t make the feature very useful. Now LANscanner will first scan for all available workgroups, and accurately report all machines on all workgroups, including which puter is the Master Browser for each workgroup. I also optimized some code here and there for good measure.


UPDATE (23 December 2012): Thanks to some adventures by frank in bahia, there is one thing you will want to check if you have problems with LANscanner. As he wrote in his comment below:

Second only to “is the PC turned on” in the obvious fix category is “is Client for Microsoft Networks installed”.

What I’ll never understand is how those things UNinstall themselves!

To make sure Client for Microsoft Networks is installed:

  1. Open Network and Sharing Center
  2. Click “Change adapter settings”
  3. Right-click your ethernet adapter and choose Properties
  4. If “Client for Microsoft Networks” does not appear in the list of items, click the “Install…” button
  5. Choose “Client” for network feature you want to add, and then click the “Add…” button
  6. Find Microsoft’s “Client for Microsoft Networks” in the list, and click OK to install it

That should be about it. Of course, the procedure above varies a little depending on whether you’re using XP, Vista, Win 7, or Win 8, but that’s the gist of it. Thanks, frank!

UPDATE (27 January 2013): Thanks to dennis, it seems the System Error 53 is caused by workgroup and/or puter names with spaces in them. This has been fixed in v1.4. Also, LANscanner is now built using Ocra 1.3.0 and Ruby 1.9.3, since RubyScript2Exe is now rather outdated and nonfunctional. The executable is now 26% smaller.

UPDATE (04 May 2013): Version 1.5 of LANscanner is now available. Changes to this version:

  1. LANscanner now speaks Swedish, French, and English. If you’d like the program to work in your language, please e-mail me the output of the command:  nbststat -A IPADDY,  for any IPADDY on your LAN
  2. If MAC address is detected as 00-00-00-00-00-00, we now use “arp -a IPADDY” to overcome Samba problems and retrieve a valid MAC address
  3. All character encodings are now supported (at the expense of increased EXE file size, but oh well).
  4. To sort the output by IP addy instead of by puter name, pass any argument to LANScanner, like so:  lanscan.exe ip
  5. Improved formatting for shorter IP addresses

Thanks to Mikael G for the “arp -a” tip!

UPDATE (07 May 2013): Version 1.51 is out. Added support for German and Polish Windows.

UPDATE (25 May 2013): Version 1.52 is out. Added support for the following command-line switches:

  1. -ip  =  sort output by IP address. Note that this has changed from the previous version!
  2. -w WORKGROUP  =  Scan only the workgroup called WORKGROUP
  3. -e WORKGROUP  =  Scan all workgroups except WORKGROUP

UPDATE (24 August 2013): Version 1.53 is out. Fixed -ip option so that IPs are properly numerically sorted.

UPDATE (11 November 2013): Version 1.54 is out. Added support for Spanish Windows.

UPDATE (27 April 2014): Version 1.55 is out. Added support for Norwegian Windows, plus the following command-line switches:

  1. -n = suppress the “Press any key to exit…” message at the end
  2. -m = Only display MASTER browsers found

UPDATE (22 October 2014): Version 1.56 is out. Added support for Portuguese, and changed to Ruby v2.0.0 + Ocra 1.3.3. Script is now bigger, but with Ruby 2 goodness!

UPDATE (17 December 2014): Version 1.57 is out. Added support for Japanese.


Looking to expand your network? Then check out TP-LINK’s networking equipment!

Networking , , , ,


  1. January 7th, 2014 at 15:37 | #1


    It fails when you run: `net view /domain` ?

  2. Gordon
    January 9th, 2014 at 16:21 | #2

    I have tried to run this on two different PCs in my workgroup. One is a Win7 system, and the other is WinXP. On both I get the error “System error 6118 has occured”

  3. Mike
    February 28th, 2014 at 16:56 | #3

    How about a command line switch (like “-n” as with `echo’ under Linux/Unix to suppress a newline) to suppress the trailing prompt to press Return? And a switch like “-m” would be useful to only display master browsers.

    Of course these behaviors can be implemented as workarounds right now:

    echo.|lanscan|findstr /i master

    This will echo a (newline terminated) empty line to lanscan’s input stream to take care of the trailing prompt, and then pipe lanscan’s output through findstr to only display master browsers. But this somewhat obscure syntax is awkward at best.


  4. Javier
    March 9th, 2014 at 01:17 | #4

    So, after following a bunch of instructions, my WD TV still can’t see my computer until I did the registry part and restarted.

    “1. Navigate to the following location in the registry editor.


    2. On the right side, double-click on ‘everyoneincludesanonymous’ and change the ‘Value data’ from ‘0’ to ‘1’

    3. Double-click on ‘NoLmHash’ and change the ‘Value data’ from ‘1’ to ‘0’

    4. Navigate to the following location in the registry editor:


    5. Double-click on ‘restrictnullsessaccess’ and change the ‘Value data’ from ‘1’ to ‘0’

    6. Close the registry editor
    Finally, restart your PC.

    My question is, when I used ur Lanscan program, I first got the “System Error 53″. Then when it finally worked, it showed 2 computers (mine and my dads) but the MASTER BROWSER is the WD TV Live.

    Is this good or bad?
    How do I change the master browser to my PC?

    • March 9th, 2014 at 11:57 | #5

      Well, if it works well, it’s good. If not, it’s bad. :)
      Given that the WD TV Live is probably running linux, it might be very good. I have never found a reliable way to force a Windows machine to always be the master browser in a home networking environment… except for installing a linux box and configuring Samba to announce to the network that it is a much newer “version of Windows”.

  5. Mike
    May 22nd, 2014 at 18:55 | #6

    I also get the 6118 error. Did anyone resolve that ?

  6. Peter Schlitter
    September 9th, 2014 at 03:40 | #7

    So I tried your program and did not get anything showing a master browser.
    My PC is running Windows 8.1.
    Here is the output.

    LANscanner v1.55 – ScottiesTech.Info

    Scanning LAN…

    Scanning workgroup: WORKGROUP…

    ARWEN 00-14-22-46-c9-39 WORKGROUP
    ELROND 34-23-87-c8-05-64 WORKGROUP
    FRODO 00-23-ae-6d-3e-08 WORKGROUP
    GANDALF 00-1b-21-14-6b-ec WORKGROUP
    WDTVLIVE 00-90-a9-61-56-5f WORKGROUP

    Press any key to exit…

    Lynksys is a router, Arwen running win 7,Gandalf running Ubuntu 14.04
    all others are windows 8.1
    For some reason I get no response from my router. I expect that must be the master browser.

  7. umberto
    September 19th, 2014 at 21:31 | #8

    Thanks Mate, nice tool.

  8. Angelo
    October 22nd, 2014 at 15:19 | #9

    It speaks Portuguese now! Thanks for a fast and great work, Scottie.
    All the best :)

  9. Jaroslav
    November 28th, 2014 at 16:29 | #10

    With version 1.56 I got the System Error 53 message.
    I replaced in the host file the “tab” between IP and NAME with “space” and now its working correct.

    • November 28th, 2014 at 22:06 | #11

      Well, that’s interesting. I don’t get System Error 53, and I use tabs in my hosts file. I’m guessing this is nevertheless a clue to something, but I just don’t know what that “something” is! ;)

  10. Angelo
    November 29th, 2014 at 20:45 | #12

    Same here tabs for aligning. Never saw other than Tabs

  11. Angelo
    November 29th, 2014 at 20:51 | #13

    Further searching i found
    Maybe you saw it before though

  12. Karen
    December 15th, 2014 at 03:25 | #14

    Addendum to my previous comment (which is apparently waiting for moderation): My system error 87 is probably caused by my Windows being Japanese. I’m willing to provide translation if you send me what I need (a .po file or whatever you’re using, or just the strings you need).

    • December 15th, 2014 at 09:56 | #15

      Your previous post must have somehow been grabbed by the spam filter. Oops! Anyway, all I need is the output of the command:

      net view /domain

      Well, I’m not sure what will happen when the script encounters a Japanese string, but theoretically it should work… I hope.

  13. Karen
    December 15th, 2014 at 14:43 | #16

    The tricky thing with Japanese strings is that they are multibyte, so if the program is only expecting ASCII (or expecting a different multibyte character set) it will break apart the characters into bytes of nonsense (see http://en.wikipedia.org/wiki/Mojibake). But the only Japanese in the output of “net view /domain” was at the end, the meaning of which is “The command finished normally.” Here is the complete output (my LAN workgroup is called “OT”):



  14. Karen
    December 15th, 2014 at 14:56 | #17

    I ran into a funny thing on my machine, which is set up for running a virtual machine as a webserver for development. In addition to my real wireless and wired LAN adapters, there is an “ethernet adapter VirtualBox Host-Only Network”, which is on a different subnet for connecting only to the virtual box internally. When I run your tool (even if my virtual box is not running at the time), it shows that connection instead of my regular one:


    • December 15th, 2014 at 21:55 | #18

      I’ve never understood exactly what that VirtualBox Host-Only Network virtual network adapter actually does, but I do know that on every Windows machine where it was enabled, sharing folders and seeing other puters on the network became a big problem. The minute I disable it, POOF! Windows networking works well again.

      I’m not sure why this happens, but given my experiences, I’m not surprised it screws up Lanscanner…

  15. Karen
    December 15th, 2014 at 14:59 | #19

    Hmm, I think the spam filter got me again. The last line of the command output is the only part in Japanese (“the command finished normally”) – in Japanese it’s as follows:


  16. Karen
    December 16th, 2014 at 01:58 | #21

    Oh well, it looks like the character set problem reared its ugly head – this is the output I got:


    LANscanner v1.57 – ScottiesTech.Info

    Scanning LAN…
    C:/Users/Karen/AppData/Local/Temp/ocr1707.tmp/test/lanscan.rb:78:in `match': incompatible encoding regexp match (UTF-8 regexp with Windows-31J string) (Encoding::CompatibilityError)
    from C:/Users/Karen/AppData/Local/Temp/ocr1707.tmp/test/lanscan.rb:78:in `match’
    from C:/Users/Karen/AppData/Local/Temp/ocr1707.tmp/test/lanscan.rb:78:in `block in ‘
    from C:/Users/Karen/AppData/Local/Temp/ocr1707.tmp/test/lanscan.rb:77:in `each_line’
    from C:/Users/Karen/AppData/Local/Temp/ocr1707.tmp/test/lanscan.rb:77:in `’

    But I’m confused – it seems to be saying that the regexp is UTF-8, and the string looks fine on this webpage that is UTF-8, so something lost the string’s encoding in between. Perhaps your Ruby compiler?

  17. Sharp
    December 21st, 2014 at 14:46 | #22

    NOT WORKING on WIN 8.1

    Getting system error 87…


    • December 21st, 2014 at 18:15 | #23

      Are you using Danish Windows? If so, what’s the output of the command:

      net view /domain


  18. Gary
    January 5th, 2015 at 01:17 | #24

    Scottie :
    It fails when you run: `net view /domain` ?

    Something similar here. The LanScanner gives the error
    “System error 53 has occurred.

    The network path was not found.”

    So take a step back and try net view /domain which gives the same error
    But as I dont use a domain I tried net view and that gives the same error as well.

  19. ErrorReporter
    January 15th, 2015 at 10:19 | #25

    If I run this nice tool from another drive then C:, I get the following errors:

    C:/Users/MyName/AppData/Local/Temp/ocr7DE7.tmp/test/lanscan.rb:142:in “': No such file or directory – nbtstat.exe -A (Errno::ENOENT)
    from C:/Users/MyName/AppData/Local/Temp/ocr7DE7.tmp/test/lanscan.rb:142:in `block in ‘
    from C:/Users/MyName/AppData/Local/Temp/ocr7DE7.tmp/test/lanscan.rb:132:in `each’
    from C:/Users/MyName/AppData/Local/Temp/ocr7DE7.tmp/test/lanscan.rb:132:in `’

    It runs fine on my Win7 Ultimate from C:\SomeFolder, but not from USB-Stick or D: or E: or higher drive letter.

    Could you please fix that?

    • January 15th, 2015 at 21:29 | #26

      As far as I can tell, I can’t. It must be running from a drive where Windows is installed since it calls Windows commands. My efforts at using environment variables and such didn’t help.

  20. jobe
    March 26th, 2015 at 21:55 | #27

    Same error 6118 for me.
    It fails when I run: `net view /domain` , too.

    My problem is disappearing NAS in my network?!?
    Any thoughts?

  21. Dave N
    March 30th, 2015 at 15:05 | #28

    Scott, This is a great tool. However my company won’t let me use it unless they can view the source code. Any chance of getting a look at the source?

  22. Dave N
    March 30th, 2015 at 21:05 | #30


Comment pages
  1. November 4th, 2010 at 20:51 | #1
  2. November 13th, 2010 at 03:32 | #2