• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

Yet another Samba-related (or maybe hostname or NetBIOS-related) problem

Bear in mind that I'm pretty new at this whole Linux deal.  Networking isn't my area of expertise.

Okay, info dump time:

I've got a small LAN of three PCs (and a network printer) hooked up to a gateway router (Netgear RT314).  The router also provides DHCP for the network.  Two of the PCs are Windows 98 (let's call their host names A and B, for brevity's sake); the third is running Red Hat 6.1 (we'll call it C).  I just added this machine to the network and installed RH6.1 so it can hold some data files commonly accessed by the LAN.  So, I figured, "Hey, I got a book that says Samba would be great for this.  Let's do it!"

First I set up Samba on C.  I set its access level to SHARE to match that of the Windows machines; I create a directory in which to place the shared files and create a "Share" for it in Samba.  I set up the access levels, etc., etc.

After all that, I tried to access it via Network Neighborhood, and it doesn't show up.  But, hey, no big deal, nothing in Linux ever works the first try, right?  So I comb through the help files, the unofficial HOWTO at samba.org, and a few experts-exchange questions for possibilities.

Following Samba's DIAGNOSIS file and the HOWTO, I determine that Samba is indeed running.  I can log into it in several ways from the local machine (C) itself using smbclient; I have no problem with nmblookup (again, on C).  I can even access the shared folders on my Windows boxes (A & B) from C with smbclient, which is nice, but not my original desire.  But I try using A to access the shared folders on C (Windows accessing Linux box) and it can't do it.  What's more, it can't even seem to see the machine.

From A, I can ping C by IP address within the network, but I can't ping it by host name.  Doing a "net view" only turns up the Windows machines A & B; C is completely absent.  I'm fairly sure the share is set up properly, as I can use smbclient on C to access the shared folders on C by NetBIOS name.  No, it appears that my problem may be with other parts of my network seeing the machine by NetBIOS name.

I checked my router's DHCP table, and, interestingly, the entry for C doesn't have the machine's host name--it's just blank!  Even my printer shows up with a host name.  Yet C can access the Internet and A & B with no problem.  I'm pretty sure the host name on C is configured properly; on boot, it shows up with "C login: ", and the command prompt is "[root@C /root]#  " upon logging in as root.  However, I noticed that httpd wasn't starting up properly either, reporting that it "cannot determine local host name."

So, what do I do to get this Samba working?  Am I missing an obscure parameter for smb.conf?  Is my host name not properly set up?  Is the fact that my network uses DHCP at all working against me?

Thanks, experts!

For reference, here are a couple of pertinent configuration files from C:

*** /etc/smb.conf ***
# Samba config file created using SWAT
# from (
# Date: 2003/03/19 14:57:26

# Global parameters
      workgroup = THEWORKGROUP
      netbios name = C
      server string = PII 300MHz on RedHat Linux 6.1
      security = SHARE
      log file = /var/log/samba/log.%m
      max log size = 50
      socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
      dns proxy = No
      hosts allow = 192.168.0.
      remote announce =

      comment = Home Directories
      read only = No
      browseable = No

      comment = All Printers
      path = /var/spool/samba
      print ok = Yes
      browseable = No

      comment = SHAREPUB
      path = /share/pub
      read only = No
      guest ok = Yes
      public = Yes
      force directory mode = 777
      delete readonly = yes
      create mode = 777
      wide links = no
      force create mode = 7777
      directory mode = 777


*** /etc/hosts ***      C       C       localhost.localdomain    localhost     Router  Router     A       A     B       B


  • 2
1 Solution
Gabriel OrozcoSolution ArchitectCommented:
1.- in your /etc/hosts, delete the line:     C       C
    end add a line:   C       C

2.- remote announce =
    I think it's wrong. maybe this will be better:
    remote announce =

3.- try pinging from the other computers to to see if they can access via tcp/ip. maybe you have bloqued access to your machine ;)

4.- add in the [global] secction this:
        os level = 75
        preferred master = yes
        local master = yes

restart samba and try :)
blahpersAuthor Commented:
Thanks, buddy!

The host name still doesn't show up on my gateway, but the Windows boxes can see it now, and that's all the matters as far as I'm concerned.
Gabriel OrozcoSolution ArchitectCommented:
delete this line and restart:
  remote announce =


Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now