Samba share works with ip but not with hostname

Hello,

My samba share works with smb.conf but the hostname won’t work… windows explorer doesn’t recognize \peikko even if my machine and netbios name is peikko, and /etc/hosts should be ok. It does recognize \192.168.11.2 .

My /etc/samba/smb.conf:


# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.

[global]
workgroup = ROLLEVERKKO
netbios name = PEIKKO
#name resolve order = bcast host lmhosts wins
#server string = ""
printing = cups
printcap name = cups
printcap cache time = 750
load printers = Yes
cups options = raw
use client driver = yes
map to guest = Bad User
local master = yes
preferred master = yes
os level = 65
usershare allow guests = Yes
#usershare max shares = 100
usershare owner only = False 
#username level = 0
#username map = /etc/samba/smbusers
restrict anonymous = 0
security = user
#logon path = \\%L\profiles\.msprofile
#logon home = \\%L\%U\.9xprofile
#logon drive = P:

[kameli]
comment = Kameli
inherit acls = No
path = /media/kameli/
read only = No
browseable = Yes
writable = Yes
writeable = Yes
guest ok = Yes

[lahna]
comment = Lahna
inherit acls = No
path = /media/kameli/
read only = No
browseable = Yes
writable = Yes
writeable = Yes
guest ok = Yes

My /etc/hosts


#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#    
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
#127.0.0.2      peikko.ROLLEVERKKO peikko
127.0.0.2	peikko
192.168.11.2    peikko

Try uncommenting this one:
#name resolve order = bcast host lmhosts wins
Also check the naming daemon is running with these commands in a console:

su
rcnmb status

That worked! Thank you, you are a lifesaver.

Rolle

Glad to help :slight_smile: