Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was wondering if there is a way of listing all the smb servers on a local network (like looking at a network neighborhood in windows) via the command line in fedora.

share|improve this question
    
What do you mean with 'smb servers'? Do you mean Samba servers, or do you mean all file servers (wether Samba or Windows, wether in my own or in other workgroups/domains) which speak the SMB protocol? –  Kurt Pfeifle Aug 2 '10 at 10:36
    
Also, your question's title (mentioning 'smb shares') somewhat contradicts its text (mentioning 'smb servers'). Which one did you mean? –  Kurt Pfeifle Aug 2 '10 at 14:34
add comment

2 Answers 2

up vote 3 down vote accepted
nmblookup -S WORKGROUP 

from: http://brneurosci.org/linuxsetup38b.html

share|improve this answer
    
You might need to tweak the firewall settings on a default install. –  Ophidian Jul 14 '10 at 18:46
    
I'll downvote this answer. -- I can't believe such a WRONG answer gets 2 upvotes. The given command only lists servers which are members of a workgroup named "workgroup". And it lists them regardless of OS (Samba/Linux or not, Windows or not). The question was about getting to know all SAMBA servers on the local network (regardless of workgroup name). –  Kurt Pfeifle Aug 2 '10 at 10:12
1  
Actually, he didn't say he was looking for all samba servers. He said "all the smb servers". I suppose I failed to elaborate to the degree that you did, in that you can search for wildcard workgroups--but really, I made it clear that I was referencing the manual, and I got the OP what he needed. Not to mention, I answered half a month before you did--I don't understand what you're so bent out of shape about. –  andyortlieb Oct 27 '10 at 15:00
add comment

This command is a very little known secret of Samba. It returns IP adresses of all Samba servers in one's own broadcast domain:

nmblookup __SAMBA__

This one returns a list of all NetBIOS names and their aliases of all Samba servers in the neighbourhood (it does a 'node status query'):

nmblookup -S __SAMBA__

This one returns a list of all IP adresses of SMB servers (that is, Linux+Unix/Samba or Windows) in the neighbourhood:

nmblookup '*'

Finally, all NetBIOS names and their aliases of all SMB servers (Linux+Unix/Samba or Windows):

nmblookup -S '*'


The command given in the other answer nmblookup -S WORKGROUP does NOT return all Samba or all SMB servers from the neighbourhood. Instead, it returns all servers' NetBIOS names who happen to be members of a workgroup named 'WORKGROUP'. The results are independent of the servers' OS (wether that is Windows, or wether that is Linux/Samba) -- and it is a well known fact that sometimes lots of Windows member server are part of a Samba-controlled domain or workgroup. [Yes, it happens that Samba's default workgroup name is 'WORKGROUP'... but so what??]. -- But the question was 'How do I get to know all SMB (Samba?!?) servers in my network neighbourhood?'

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.