Samba and Network Neighborhood

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Also posted in Networking:

I dunno what to do. I have a RH 7.3 running samba and it seems to be configured just fine. The problem is that I can't actually see the server in the Network Neighborhood of my Win2k machine, nor can I run: \\server. However, if I type \\serverIP it'll let me login and browse shares just fine. I searched google, Samba, AT, and did man smb.conf. I tried being Domain master, local master, lm announce, blah blah blah....I dunno what I'm doing wrong. :eek:

Here's a shortened version of my smb.conf. Help me if you can please. TIA! :confused:

[global]
workgroup = 223
lanman auth = Yes
server string = Linux
netbios name = Linux
hosts allow = 192.168.1. 192.168.2. 127.
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
username map = /etc/samba/smbusers
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Check the samba logs, they're usually pretty good about telling you what's wrong.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Your problem is probably the name resolve order.

For instance, if you are setting up SAMBA on an internal network that doesn't have DNS entries for all of your LAN hosts, then the default SAMBA name resolve order will fail. The reason is simple: Samba requires each IP address to map to a Windows hostname. Its default behavior is to use the standard Unix "gethostbyaddr" method, which attempts to use the /etc/hosts file first and then a DNS query. But if the IP address can't be found by this method, it will simply timeout.

In my opinion the EASIEST way to fix this is to turn on Samba's WINS server and change the name resolve order to eliminate the gethostbyaddr method:

[smb.conf]
name resolve order = wins lmhosts bcast
wins support = yes

Then you just need to make sure that all of your Windows machines point to the Samba server as a WINS server. It's that easy. Now, whenever your Windows machines boot, they send their Windows networking name to the WINS server, which keeps track of their IP address. Samba uses this WINS database to do the IP address to Windows Networking name mappings.

Hope that helps.
 

manly

Lifer
Jan 25, 2000
13,191
3,974
136
Good thoughtful answer, kylef. It should go into the FAQ. This thread makes me recall how non-deterministic Winblows Networking (aka SMB) can be at times. It forces people to reboot their clients multiple times in hopes of having remote shares magically reappear; another common question is how to get NetBEUI working under WXP because a lot of people still believe that's the reliable way to get SMB working.

Good to see you looked up the name resolve order parameter like I suggested recently. :p
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
thx alot kylef! that worked great! It is rather irritating, though, that I should have to do that. Oh well.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Glad to hear you got it working!

Good to see you looked up the name resolve order parameter like I suggested recently.

Yes, that was a good pointer Manly. After seeing it, I went and re-read the chapter on Windows Name Resolution in Using Samba, which is available for free download from O'Reilly's website in both PDF and HTML formats. It's a VERY enlightening book if you work with Samba on a daily basis. When I first read it, I learned oodles about how Windows networking actually operates, and then of course promptly forgot it ;) If for no other reason, you should download it now and keep it around as a reference in case O'Reilly ever decides to remove it.

I had never run into this particular issue before moving my systems to a private network. Before that, each of my systems had fully qualified DNS hostnames and therefore Samba's default "host" name resolution method worked fine by executing the old trusty "gethostbyaddr()" function call. But now that my machines have private IP addresses without hostnames, I ran into the same problem. The WINS solution seems to be the easiest fix, since the only hard part about it is to remember to list the Samba machine as a WINS server on all of the Windows clients. Everything else is done behind the scenes, transparent-like :)

Edit: Thanks to O'Reilly for making their book free and thereby spreading light into the darkness that is Windows networking...
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Originally posted by: kylef
Good to see you looked up the name resolve order parameter like I suggested recently.

Yes, that was a good pointer Manly. After seeing it, I went and re-read the chapter on Windows Name Resolution in Using Samba, which is available for free download from O'Reilly's website in both PDF and HTML formats. It's a VERY enlightening book if you work with Samba on a daily basis. When I first read it, I learned oodles about how Windows networking actually operates, and then of course promptly forgot it ;) If for no other reason, you should download it now and keep it around as a reference in case O'Reilly ever decides to remove it.

I had never run into this particular issue before moving my systems to a private network. Before that, each of my systems had fully qualified DNS hostnames and therefore Samba's default "host" name resolution method worked fine by executing the old trusty "gethostbyaddr()" function call. But now that my machines have private IP addresses without hostnames, I ran into the same problem. The WINS solution seems to be the easiest fix, since the only hard part about it is to remember to list the Samba machine as a WINS server on all of the Windows clients. Everything else is done behind the scenes, transparent-like :)

Heh, I did actually read that book in HTML format. (though I'm d/ling the pdf right now). I must have somehow missed the section of name resolve orders. What a horrible PITA it would be for a small company on a private network if they need to see samba shares. (and have a fair # of machines -- s'posing that's the fix they use) Anyway, that was the exact problem with me too. I recently installed a router and created a private network. Well, it worked great and I'm thankfull.

Cheers! :D
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Ive never had problems with that, of course, I dont use SAMBA in a Windows environment either :Q

The few times I did, the network was setup correctly.
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Originally posted by: n0cmonkey
Ive never had problems with that, of course, I dont use SAMBA in a Windows environment either :Q

The few times I did, the network was setup correctly.

I honestly don't know how my network would be incorrectly setup though. 6 computers (1 winXP, 1 win2k, 3 win98, 1 linux) all using DHCP from my router. Being that as it is it I thought it would work fine. In fact, I have had it setup before between 1 win2k and 1 win98 computer with the same globals as I posted before (except I allowed for the IPs of our computers in hosts allow), but not on a private network and it worked normally. I dunno.

I guess I just don't know enough about networking properly. :eek: **sigh**
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Gooberlx2
Originally posted by: n0cmonkey
Ive never had problems with that, of course, I dont use SAMBA in a Windows environment either :Q

The few times I did, the network was setup correctly.

I honestly don't know how my network would be incorrectly setup though. 6 computers (1 winXP, 1 win2k, 3 win98, 1 linux) all using DHCP from my router. Being that as it is it I thought it would work fine. In fact, I have had it setup before between 1 win2k and 1 win98 computer with the same globals as I posted before (except I allowed for the IPs of our computers in hosts allow), but not on a private network and it worked normally. I dunno.

I guess I just don't know enough about networking properly. :eek: **sigh**

You have linux, setup BIND. It could be fun :)

Forget dhcp, you dont have many machines to admin.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I honestly don't know how my network would be incorrectly setup though. 6 computers (1 winXP, 1 win2k, 3 win98, 1 linux) all using DHCP from my router.

The dhcp server in those routers usually suck, friend of mine has one and all it gives you is an IP and gateway with no options for anything else. And instead of keeping a persistent list of handed out IPs it just arps around the whole subnet, 1 IP a second. If you setup a real DHCP server you can specify dns server, wins server, dns domain, etc.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
And instead of keeping a persistent list of handed out IPs it just arps around the whole subnet, 1 IP a second.

That is certainly a poor implementation, but I believe they're getting better. For instance, my brand new Dlink DI-604 ($48 shipped) maintains a MAC address to IP address table and even allows you to control how long it grants the DHCP leases and what range of IP addresses to hand out. It's certainly not as flexible as runnning DHCPd, but then again, it requires much less maintenance.

You have linux, setup BIND. It could be fun.

Sure, but remember the WINS server is the EASIEST way to fix the problem. I don't consider learning and configuring BIND worthwhile for most people. But hey, if you're into that sort of thing, go for it! :p
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Originally posted by: kylef
And instead of keeping a persistent list of handed out IPs it just arps around the whole subnet, 1 IP a second.

That is certainly a poor implementation, but I believe they're getting better. For instance, my brand new Dlink DI-604 ($48 shipped) maintains a MAC address to IP address table and even allows you to control how long it grants the DHCP leases and what range of IP addresses to hand out. It's certainly not as flexible as runnning DHCPd, but then again, it requires much less maintenance.

You have linux, setup BIND. It could be fun.

Sure, but remember the WINS server is the EASIEST way to fix the problem. I don't consider learning and configuring BIND worthwhile for most people. But hey, if you're into that sort of thing, go for it! :p

Yeah, the linksys router I have seems pretty sweet, IMHO. It has a mac-address to IP clients table...and a some ther stuff I'll never use (like IP/mac filters and dynamic/static routing). Yeah, I read through the HOWTO on BIND. (Hell I gotta read the Networking-Overview HOWTO) That's alot more work than I care to do at the moment. ;)

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yeah, I read through the HOWTO on BIND. (Hell I gotta read the Networking-Overview HOWTO) That's alot more work than I care to do at the moment.

Setting up a small internal domain in BIND is really simple, the sytax is a little daunting at first but once you have the skeleton zone files setup it's nothing. I have dns with dhcp automatically updating it at home and it's worked fine since I set it up.

Sure, but remember the WINS server is the EASIEST way to fix the problem.

And telling nmbd to do WINS is just 1 config file parameter, the problem is getting the clients to realize there's a wins server to use since those chincy routers don't usually let you specify things like that.
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
Setting up a small internal domain in BIND is really simple, the sytax is a little daunting at first but once you have the skeleton zone files setup it's nothing. I have dns with dhcp automatically updating it at home and it's worked fine since I set it up.

Well, I'll definitely be looking at that stuff and might tinker around to try to set it up when I have some free time. Thx for the info guys! :)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: kylef
You have linux, setup BIND. It could be fun.

Sure, but remember the WINS server is the EASIEST way to fix the problem. I don't consider learning and configuring BIND worthwhile for most people. But hey, if you're into that sort of thing, go for it! :p

Its all about the resume :)

And hell, having my own name servers is nice.