Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba problem, Windows machines don't know hostnames.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gilesjuk
Guru
Guru


Joined: 11 Feb 2003
Posts: 412
Location: Staffordshire, UK

PostPosted: Fri Dec 26, 2003 6:45 pm    Post subject: Samba problem, Windows machines don't know hostnames. Reply with quote

When I refer to my Linux box using its IP address the Windows machine can connect and view shares. But enter its name and it can't find the hostname.

If I go to Network Places nothing appears.

I'm using Samba 3 but it did the same with Samba 2. I don't understand the whole netbios, wins rubbish, why do Microsoft make everything so complex?
_________________
^<^>^<^>^
G. Jones
-=-=-=-=-=-
Back to top
View user's profile Send private message
astika
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 131
Location: /usr/local/src

PostPosted: Fri Dec 26, 2003 6:54 pm    Post subject: Reply with quote

you would need to add an entry for the Linux box to your 'hosts' file on the
Windows box.

possible locations:
Windows 95/98/Me > c:\windows\hosts
Windows NT/2000/XP Pro > c:\winnt\system32\drivers\etc\hosts
Windows XP Home > c:\windows\system32\drivers\etc\hosts

open it in a text editor, it should look like this:
Code:

# Copyright (c) 1998 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP stack for Windows98
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
127.0.0.1     localhost


under the last line, add another entry in the same format:
Code:

192.168.1.101     linuxBox


replace the IP with your IP, and change it to the appropriate name.
File > Save > Close

Now, when you refer to your Linux machine by name, Windows will search
the hosts file for an entry, and then if one exists, will use the IP associated
with that name.

Hope this helps you.
_________________
even now in heaven, there were angels carrying savage weapons
Back to top
View user's profile Send private message
CMI
Apprentice
Apprentice


Joined: 19 Aug 2003
Posts: 205

PostPosted: Fri Dec 26, 2003 7:48 pm    Post subject: Reply with quote

You need to make sure nmbd is running and properly configured. Make sure workgroup is properly set in /etc/samba/smb.conf.
_________________
SECOMGroup - Lineman.net
LightPHPCMS - PhotoGallery
Back to top
View user's profile Send private message
kwiqsilver
Guru
Guru


Joined: 19 Mar 2003
Posts: 360

PostPosted: Fri Dec 26, 2003 8:01 pm    Post subject: Re: Samba problem, Windows machines don't know hostnames. Reply with quote

gilesjuk wrote:
why do Microsoft make everything so complex?

So people will be more likely to run a 100% microsoft network and they can get more money. ;)

mikeD's fix will solve your problem. I was about to post the same thing (with nowhere near as much detail though), but he beat me to it.

You can test it by bringing up a dos window and pinging your linux box by name.
Back to top
View user's profile Send private message
astika
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2003
Posts: 131
Location: /usr/local/src

PostPosted: Fri Dec 26, 2003 8:15 pm    Post subject: Reply with quote

keep in mind, this is no replacement for announcing names over a network,
whether it be windows or linux. HOSTS file is typically used in those
situations where there is no internal DNS entry for the target machine, or
NETBIOS doesn't work ;)

you will need to do some additional configuring in samba, etc to get it truly
working. and that, i am afriad, i don't know. :(
_________________
even now in heaven, there were angels carrying savage weapons
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sat Dec 27, 2003 7:22 am    Post subject: Reply with quote

mikeD wrote:
keep in mind, this is no replacement for announcing names over a network,
whether it be windows or linux. HOSTS file is typically used in those
situations where there is no internal DNS entry for the target machine, or
NETBIOS doesn't work ;)

you will need to do some additional configuring in samba, etc to get it truly
working. and that, i am afriad, i don't know. :(


And it's so easy, too! ;-)

All you have to do is the following:

1. open up /etc/samba/smb.conf in your favorite text editor
2. in the [global] section, make sure that "wins support" is enabled; this will cause the Linux box to act as a WINS server for the subnet
3. set samba's "os level" to 65 or higher - this is needed to make it win the master browser elections against any Win2K / WinXP boxes.
4. save smb.conf and exit, no need to sighup samba or anything, all changes to samba config take effect within a minute or so
5. in the Windows box's Networking dialog box (WINS tab) enter the samba server's IP address

That'll be all, sir.

NOTE that with a standard samba install probably all you have to do is name the samba box as a WINS server for the Windows network, but this way it will always work...
Back to top
View user's profile Send private message
Krigg
n00b
n00b


Joined: 22 Apr 2003
Posts: 59
Location: Out There

PostPosted: Thu Jan 08, 2004 2:27 pm    Post subject: Reply with quote

Well I've tried all of those suggestions, yet I still get no love from my Windows machines.

I use the tool browstat in a DOS shell to see what the problem is and I get this message;

Code:

Status for domain MYLINUXDOMAIN on transport \Device\NetBT_Tcpip_<423452A-4123-4b56-A4D4-0F9839G19191>

Browsing is active on domain.
Master browser name is: MYSAMBASERVER

Could not connect to registry, error = 5      Unable to determine build of browser master:5
Unable to determine server information for browser master: 5
1 backup servers retrieved from master MYSAMBASERVER
      \\MYOTHERSERVER
Unable to retrieve server list from MYSAMBASERVER: 1326


I've been searching and haven't found an answer to my queries yet....although I must admit, I'm not the best googler.

Here is my smb.conf global

Code:

[global]
        log file = /var/log/samba/log.%m
        guest account = pcguest
        smb passwd file = /etc/samba/private/smbpasswd
        name resolve order = wins lmhosts bcast host
        socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
        browse list = yes
        interfaces = 192.168.0.2/255.255.255.0
        encrypt passwords = yes
        passwd program = /etc/samba/private/smbpasswd
        available = no
        wins support = yes
        dns proxy = no
        netbios name = thorin
        browseable = no
        default = homes
        remote announce = 192.168.0.0/192.168.0.255
        domain master = no
        local master = yes
        preferred master = yes
        workgroup = MYWORKGROUP
        os level = 65
        printcap name = cups
        security = user
        max log size = 50


Windows can't browse the LAN at all, none of my windows machines can....

I keep thinking that nmbd isn't working properly, but I can't seem to find out why.

any thoughts?

JR
_________________
Have gun, will carry!
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Thu Jan 08, 2004 4:28 pm    Post subject: Reply with quote

Dump both the "interfaces=" and the "remote announce=" lines, because they are:
A. unnecessary, and
B. wrong!

The interfaces= line specifies a *host*, no host ever has a netmask associated with it.
The remote announce= line specifies a netbios broadcast subnet, which you don't *need*, and in any case doesn't specify a valid subnet.

Use testparm!

Please read a good tcp/ip primer when dealing with any type of networking (yes, I know - you don't need to know how a network works when you use WindBlows - unfortunately, you DO need to know when using a real OS).

And have you noticed that you use a domain of MYLINUXDOMAIN while your workgroup is called MYWORKGROUP ?

And that you queried for MYSAMBASERVER while you set the netbios name to "thorin" in smb.conf ?

You really need to get that information in line.
Back to top
View user's profile Send private message
Krigg
n00b
n00b


Joined: 22 Apr 2003
Posts: 59
Location: Out There

PostPosted: Fri Jan 09, 2004 8:45 am    Post subject: Reply with quote

Ooops, that config file was improperly presented to you, the viewing public.

I tried to clean it up to hide my internal names...

Here is a cleaned version

Code:

[global]
        log file = /var/log/samba/log.%m
        guest account = pcguest
        smb passwd file = /etc/samba/private/smbpasswd
        name resolve order = wins lmhosts bcast host
        socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192
        browse list = yes
        interfaces = 192.168.0.0/255.255.255.0
        encrypt passwords = yes
        passwd program = /etc/samba/private/smbpasswd
        available = no
        wins support = yes
        dns proxy = no
        netbios name = MYSAMBASERVER
        browseable = no
        default = homes
        remote announce = 192.168.0.0/192.168.0.255
        domain master = no
        local master = yes
        preferred master = yes
        workgroup = MYWORKGROUP
        os level = 65
        printcap name = cups
        security = user
        max log size = 50


But you're saying that both the Interfaces and remote announce lines can be removed without a problem?

Oh, and I have a subnetted Class C network with a netmask of 255.255.255.224

So would I want to have some sort of indicator like 192.168.0.32/27 or something like that as the interface?

If you understand subnets, there are 6 available with that netmask, with 30 hosts each....I did this to provide some isolated test networks for myself. And I am fairly well familiarized with Networking protocols. What I'm not familar with is Linux or Samba....this is why I'm asking.

JR
_________________
Have gun, will carry!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum