You are not logged in.

#1 2013-08-03 03:05:38

degmic71
Member
Registered: 2009-02-03
Posts: 122

Really noob issue with hostname (samba, hostname resolution)

Simple one hopefully for you guys:

I can ping my laptop, FedoraMTD, but the laptop cannot ping me (ArchBoxMTD), but can as the IP address 192.168.11.30.  Is there something that is messed up?

ArchBoxMTD /home/mikeyd  # hostname
ArchBoxMTD

I can ping the laptop fine, so I am guessing I have some sort of error in my laptop (FedoraMTD) smb.conf?

mikeyd@ArchBoxMTD ~  $ ping -c 2 FedoraMTD
PING FedoraMTD (192.168.11.13) 56(84) bytes of data.
64 bytes from FedoraMTD (192.168.11.13): icmp_seq=1 ttl=64 time=200 ms
64 bytes from FedoraMTD (192.168.11.13): icmp_seq=2 ttl=64 time=121 ms

--- FedoraMTD ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 121.586/161.030/200.474/39.444 ms

I should also mention that I *can* connect from my Fedora laptop via :

//ArchBoxMTD/server_media_x     /mnt/ArchBoxMTD_smx cifs credentials=/home/mikeyd/sambaconfigs/sambacreds,workgroup=WORKGROUP,ip=192.168.11.30 0 0

Samba file from ArchBoxMTD:

	

    # This is the main Samba configuration file. You should read the
    # smb.conf(5) manual page in order to understand the options listed
    # here. Samba has a huge number of configurable options (perhaps too
    # many!) most of which are not shown in this example
    #
    # Any line which starts with a ; (semi-colon) or a # (hash)
    # is a comment and is ignored. In this example we will use a #
    # for commentry and a ; for parts of the config file that you
    # may wish to enable
    #
    # NOTE: Whenever you modify this file you should run the command "testparm"
    # to check that you have not made any basic syntactic errors.
    #
    #======================= Global Settings =====================================
    [global]
     
    # workgroup = NT-Domain-Name or Workgroup-Name
       workgroup = WORKGROUP
     
    # server string is the equivalent of the NT Description field
       server string = ArchBoxMTD
     
    #set usershare
            usershare path = /var/lib/samba/usershares
            usershare max shares = 100
            usershare allow guests = yes
            usershare owner only = false
     
    # This option is important for security. It allows you to restrict
    # connections to machines which are on your local network. The
    # following example restricts access to two C class networks and
    # the "loopback" interface. For more examples of the syntax see
    # the smb.conf man page
    ;   hosts allow = 192.168.1. 192.168.2. 127.
     
    # if you want to automatically load your printer list rather
    # than setting them up individually then you'll need this
       printcap name = /etc/printcap
       load printers = yes
     
    # It should not be necessary to spell out the print system type unless
    # yours is non-standard. Currently supported print systems include:
    # bsd, sysv, plp, lprng, aix, hpux, qnx
    ;   printing = bsd
     
    # Uncomment this if you want a guest account, you must add this to /etc/passwd
    # otherwise the user "nobody" is used
    ;  guest account = pcguest
     
    # this tells Samba to use a separate log file for each machine
    # that connects
       log file = /var/log/samba/%m.log
     
    # Put a capping on the size of the log files (in Kb).
       max log size = 50
     
    # Security mode. Most people will want user level security. See
    # security_level.txt for details.
       security = user
    # Use password server option only with security = server
    ;   password server = <NT-Server-Name>
     
    # Password Level allows matching of _n_ characters of the password for
    # all combinations of upper and lower case.
    ;  password level = 8
    ;  username level = 8
     
    # You may wish to use password encryption. Please read
    # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
    # Do not enable this option unless you have read those documents
    ;  encrypt passwords = yes
    ;  smb passwd file = /etc/samba/smbpasswd
     
    # The following are needed to allow password changing from Windows to
    # update the Linux sytsem password also.
    # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
    # NOTE2: You do NOT need these to allow workstations to change only
    #        the encrypted SMB passwords. They allow the Unix password
    #        to be kept in sync with the SMB password.
    ;  unix password sync = Yes
    ;  passwd program = /usr/bin/passwd %u
    ;  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
     
    # Unix users can map to different SMB User names
    ;  username map = /etc/samba/smbusers
     
    # Using the following line enables you to customise your configuration
    # on a per machine basis. The %m gets replaced with the netbios name
    # of the machine that is connecting
    ;   include = /etc/samba/smb.conf.%m
     
    # Configure Samba to use multiple interfaces
    # If you have multiple network interfaces then you must list them
    # here. See the man page for details.
    ;   interfaces = 192.168.12.2/24 192.168.13.2/24
     
    # Configure remote browse list synchronisation here
    #  request announcement to, or browse list sync from:
    #       a specific host or from / to a whole subnet (see below)
    ;   remote browse sync = 192.168.3.25 192.168.5.255
    # Cause this host to announce itself to local subnets here
    ;   remote announce = 192.168.1.255 192.168.2.44
     
    # Browser Control Options:
    # set local master to no if you don't want Samba to become a master
    # browser on your network. Otherwise the normal election rules apply
    ;       local master = no
     
    # OS Level determines the precedence of this server in master browser
    # elections. The default value should be reasonable
    ;   os level = 33
     
    # Domain Master specifies Samba to be the Domain Master Browser. This
    # allows Samba to collate browse lists between subnets. Don't use this
    # if you already have a Windows NT domain controller doing this job
    ;   domain master = yes
     
    # Preferred Master causes Samba to force a local browser election on startup
    # and gives it a slightly higher chance of winning the election
    ;   preferred master = yes
     
    # Use only if you have an NT server on your network that has been
    # configured at install time to be a primary domain controller.
    ;   domain controller = <NT-Domain-Controller-SMBName>
     
    # Enable this if you want Samba to be a domain logon server for
    # Windows95 workstations.
    ;   domain logons = yes
     
    # if you enable domain logons then you may want a per-machine or
    # per user logon script
    # run a specific logon batch file per workstation (machine)
    ;   logon script = %m.bat
    # run a specific logon batch file per username
    ;   logon script = %U.bat
     
    # Where to store roving profiles (only for Win95 and WinNT)
    #        %L substitutes for this servers netbios name, %U is username
    #        You must uncomment the [Profiles] share below
    ;   logon path = \\%L\Profiles\%U
     
    # All NetBIOS names must be resolved to IP Addresses
    # 'Name Resolve Order' allows the named resolution mechanism to be specified
    # the default order is "host lmhosts wins bcast". "host" means use the unix
    # system gethostbyname() function call that will use either /etc/hosts OR
    # DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
    # and the /etc/resolv.conf file. "host" therefore is system configuration
    # dependant. This parameter is most often of use to prevent DNS lookups
    # in order to resolve NetBIOS names to IP Addresses. Use with care!
    # The example below excludes use of name resolution for machines that are NOT
    # on the local network segment
    # - OR - are not deliberately to be known via lmhosts or via WINS.
    ; name resolve order = wins lmhosts bcast
     
    # Windows Internet Name Serving Support Section:
    # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
    ;   wins support = yes
     
    # WINS Server - Tells the NMBD components of Samba to be a WINS Client
    #       Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
    ;   wins server = w.x.y.z
     
    # WINS Proxy - Tells Samba to answer name resolution queries on
    # behalf of a non WINS capable client, for this to work there must be
    # at least one  WINS Server on the network. The default is NO.
    ;   wins proxy = yes
     
    # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
    # via DNS nslookups. The built-in default for versions 1.9.17 is yes,
    # this has been changed in version 1.9.18 to no.
       dns proxy = no
     
    # Case Preservation can be handy - system default is _no_
    # NOTE: These can be set on a per share basis
    ;  preserve case = no
    ;  short preserve case = no
    # Default case is normally upper case for all DOS files
    ;  default case = lower
    # Be very careful with case sensitivity - it can break things!
    ;  case sensitive = no
     
    #============================ Share Definitions ==============================
    [homes]
       comment = Home Directories
       browseable = yes
       writable = yes
     
    [server_media_x]
        comment = server media x drive
        path = /mnt/server_media_x
        read only = no
        writeable = yes
        browseable = yes
        valid users = mikeyd
        create mask = 0644
        directory mask = 0755
        inherit acls = yes
        ; if you set this, all files get written as this user
        #force user = one
     
    # Un-comment the following and create the netlogon directory for Domain Logons
    ; [netlogon]
    ;   comment = Network Logon Service
    ;   path = /home/netlogon
    ;   guest ok = yes
    ;   writable = no
    ;   share modes = no
     
     
    # Un-comment the following to provide a specific roving profile share
    # the default is to use the user's home directory
    ;[Profiles]
    ;    path = /home/profiles
    ;    browseable = no
    ;    guest ok = yes
     
     
    # NOTE: If you have a BSD-style print system there is no need to
    # specifically define each individual printer
    [printers]
       comment = All Printers
       path = /var/spool/samba
       browseable = no
    # Set public = yes to allow user 'guest account' to print
       guest ok = no
       writable = no
       printable = yes
     
    # This one is useful for people to share files
    ;[tmp]
    ;   comment = Temporary file space
    ;   path = /tmp
    ;   read only = no
    ;   public = yes
     
    # A publicly accessible directory, but read only, except for people in
    # the "staff" group
    ;[public]
    ;   comment = Public Stuff
    ;   path = /home/samba
    ;   public = yes
    ;   read only = yes
    ;   write list = @staff
     
    # Other examples.
    #
    # A private printer, usable only by fred. Spool data will be placed in fred's
    # home directory. Note that fred must have write access to the spool directory,
    # wherever it is.
    ;[fredsprn]
    ;   comment = Fred's Printer
    ;   valid users = fred
    ;   path = /homes/fred
    ;   printer = freds_printer
    ;   public = no
    ;   writable = no
    ;   printable = yes
     
    # A private directory, usable only by fred. Note that fred requires write
    # access to the directory.
    ;[fredsdir]
    ;   comment = Fred's Service
    ;   path = /usr/somewhere/private
    ;   valid users = fred
    ;   public = no
    ;   writable = yes
    ;   printable = no
     
    # a service which has a different directory for each machine that connects
    # this allows you to tailor configurations to incoming machines. You could
    # also use the %u option to tailor it by user name.
    # The %m gets replaced with the machine name that is connecting.
    ;[pchome]
    ;  comment = PC Directories
    ;  path = /usr/pc/%m
    ;  public = no
    ;  writable = yes
     
    # A publicly accessible directory, read/write to all users. Note that all files
    # created in the directory by users will be owned by the default user, so
    # any user with access can delete any other user's files. Obviously this
    # directory must be writable by the default user. Another user could of course
    # be specified, in which case all files would be owned by that user instead.
    ;[public]
    ;   path = /usr/somewhere/else/public
    ;   public = yes
    ;   only guest = yes
    ;   writable = yes
    ;   printable = no
     
    # The following two entries demonstrate how to share a directory so that two
    # users can place files there that will be owned by the specific users. In this
    # setup, the directory should be writable by both users and should have the
    # sticky bit set on it to prevent abuse. Obviously this could be extended to
    # as many users as required.
    ;[myshare]
    ;   comment = Mary's and Fred's stuff
    ;   path = /usr/somewhere/shared
    ;   valid users = mary fred
    ;   public = no
    ;   writable = yes
    ;   printable = no
    ;   create mask = 0765

smb.conf From FedoraMTD:

# This is the main Samba configuration file. For detailed information about the
# options listed here, refer to the smb.conf(5) manual page. Samba has a huge
# number of configurable options, most of which are not shown in this example.
#
# The Official Samba 3.2.x HOWTO and Reference Guide contains step-by-step
# guides for installing, configuring, and using Samba:
# http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# The Samba-3 by Example guide has working examples for smb.conf. This guide is
# generated daily: http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# In this file, lines starting with a semicolon (;) or a hash (#) are
# comments and are ignored. This file uses hashes to denote commentary and
# semicolons for parts of the file you may wish to configure.
#
# Note: Run the "testparm" command after modifying this file to check for basic
# syntax errors.
#
#---------------
# Security-Enhanced Linux (SELinux) Notes:
#
# Turn the samba_domain_controller Boolean on to allow Samba to use the useradd
# and groupadd family of binaries. Run the following command as the root user to
# turn this Boolean on:
# setsebool -P samba_domain_controller on
#
# Turn the samba_enable_home_dirs Boolean on if you want to share home
# directories via Samba. Run the following command as the root user to turn this
# Boolean on:
# setsebool -P samba_enable_home_dirs on
#
# If you create a new directory, such as a new top-level directory, label it
# with samba_share_t so that SELinux allows Samba to read and write to it. Do
# not label system directories, such as /etc/ and /home/, with samba_share_t, as
# such directories should already have an SELinux label.
#
# Run the "ls -ldZ /path/to/directory" command to view the current SELinux
# label for a given directory.
#
# Set SELinux labels only on files and directories you have created. Use the
# chcon command to temporarily change a label:
# chcon -t samba_share_t /path/to/directory
#
# Changes made via chcon are lost when the file system is relabeled or commands
# such as restorecon are run.
#
# Use the samba_export_all_ro or samba_export_all_rw Boolean to share system
# directories. To share such directories and only allow read-only permissions:
# setsebool -P samba_export_all_ro on
# To share such directories and allow read and write permissions:
# setsebool -P samba_export_all_rw on
#
# To run scripts (preexec/root prexec/print command/...), copy them to the
# /var/lib/samba/scripts/ directory so that SELinux will allow smbd to run them.
# Note that if you move the scripts to /var/lib/samba/scripts/, they retain
# their existing SELinux labels, which may be labels that SELinux does not allow
# smbd to run. Copying the scripts will result in the correct SELinux labels.
# Run the "restorecon -R -v /var/lib/samba/scripts" command as the root user to
# apply the correct SELinux labels to these files.
#
#--------------
#
#======================= Global Settings =====================================
 
[global]
 
# ----------------------- Network-Related Options -------------------------
#
# workgroup = the Windows NT domain name or workgroup name, for example, MYGROUP.
#
# server string = the equivalent of the Windows NT Description field.
#
# netbios name = used to specify a server name that is not tied to the hostname.
#
# interfaces = used to configure Samba to listen on multiple network interfaces.
# If you have multiple interfaces, you can use the "interfaces =" option to
# configure which of those interfaces Samba listens on. Never omit the localhost
# interface (lo).
#
# hosts allow = the hosts allowed to connect. This option can also be used on a
# per-share basis.
#
# hosts deny = the hosts not allowed to connect. This option can also be used on
# a per-share basis.
#
# max protocol = used to define the supported protocol. The default is NT1. You
# can set it to SMB2 if you want experimental SMB2 support.
#
        workgroup = WORKGROUP
        server string = FedoraMTD
 
;       netbios name = FedoraMTD
 
;       interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
;       hosts allow = 127. 192.168.12. 192.168.13.
 
;       max protocol = SMB2
 
# --------------------------- Logging Options -----------------------------
#
# log file = specify where log files are written to and how they are split.
#
# max log size = specify the maximum size log files are allowed to reach. Log
# files are rotated when they reach the size specified with "max log size".
#
 
        # log files split per-machine:
        log file = /var/log/samba/log.%m
        # maximum size of 50KB per log file, then rotate:
        max log size = 50
 
# ----------------------- Standalone Server Options ------------------------
#
# security = the mode Samba runs in. This can be set to user, share
# (deprecated), or server (deprecated).
#
# passdb backend = the backend used to store user information in. New
# installations should use either tdbsam or ldapsam. No additional configuration
# is required for tdbsam. The "smbpasswd" utility is available for backwards
# compatibility.
#
 
        security = user
;       passdb backend = tdbsam
 
 
# ----------------------- Domain Members Options ------------------------
#
# security = must be set to domain or ads.
#
# passdb backend = the backend used to store user information in. New
# installations should use either tdbsam or ldapsam. No additional configuration
# is required for tdbsam. The "smbpasswd" utility is available for backwards
# compatibility.
#
# realm = only use the realm option when the "security = ads" option is set.
# The realm option specifies the Active Directory realm the host is a part of.
#
# password server = only use this option when the "security = server"
# option is set, or if you cannot use DNS to locate a Domain Controller. The
# argument list can include My_PDC_Name, [My_BDC_Name], and [My_Next_BDC_Name]:
#
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
#
# Use "password server = *" to automatically locate Domain Controllers.
 
;       realm = MY_REALM
 
;       password server = <NT-Server-Name>
 
# ----------------------- Domain Controller Options ------------------------
#
# security = must be set to user for domain controllers.
#
# passdb backend = the backend used to store user information in. New
# installations should use either tdbsam or ldapsam. No additional configuration
# is required for tdbsam. The "smbpasswd" utility is available for backwards
# compatibility.
#
# domain master = specifies Samba to be the Domain Master Browser, allowing
# Samba to collate browse lists between subnets. Do not use the "domain master"
# option if you already have a Windows NT domain controller performing this task.
#
# domain logons = allows Samba to provide a network logon service for Windows
# workstations.
#
# logon script = specifies a script to run at login time on the client. These
# scripts must be provided in a share named NETLOGON.
#
# logon path = specifies (with a UNC path) where user profiles are stored.
#
#
 
;       domain master = yes
;       domain logons = yes
 
        # the following login script name is determined by the machine name
        # (%m):
;       logon script = %m.bat
        # the following login script name is determined by the UNIX user used:
;       logon script = %u.bat
;       logon path = \\%L\Profiles\%u
        # use an empty path to disable profile support:
;       logon path =
 
        # various scripts can be used on a domain controller or a stand-alone
        # machine to add or delete corresponding UNIX accounts:
 
;       add user script = /usr/sbin/useradd "%u" -n -g users
;       add group script = /usr/sbin/groupadd "%g"
;       add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
;       delete user script = /usr/sbin/userdel "%u"
;       delete user from group script = /usr/sbin/userdel "%u" "%g"
;       delete group script = /usr/sbin/groupdel "%g"
 
 
# ----------------------- Browser Control Options ----------------------------
#
# local master = when set to no, Samba does not become the master browser on
# your network. When set to yes, normal election rules apply.
#
# os level = determines the precedence the server has in master browser
# elections. The default value should be reasonable.
#
# preferred master = when set to yes, Samba forces a local browser election at
# start up (and gives itself a slightly higher chance of winning the election).
#
        local master = no
;       os level = 33
;       preferred master = yes
 
#----------------------------- Name Resolution -------------------------------
#
# This section details the support for the Windows Internet Name Service (WINS).
#
# Note: Samba can be either a WINS server or a WINS client, but not both.
#
# wins support = when set to yes, the NMBD component of Samba enables its WINS
# server.
#
# wins server = tells the NMBD component of Samba to be a WINS client.
#
# wins proxy = when set to yes, Samba answers name resolution queries on behalf
# of a non WINS capable client. For this to work, there must be at least one
# WINS server on the network. The default is no.
#
# dns proxy = when set to yes, Samba attempts to resolve NetBIOS names via DNS
# nslookups.
 
;       wins support = yes
;       wins server = w.x.y.z
;       wins proxy = yes
 
;       dns proxy = yes
 
# --------------------------- Printing Options -----------------------------
#
# The options in this section allow you to configure a non-default printing
# system.
#
# load printers = when set you yes, the list of printers is automatically
# loaded, rather than setting them up individually.
#
# cups options = allows you to pass options to the CUPS library. Setting this
# option to raw, for example, allows you to use drivers on your Windows clients.
#
# printcap name = used to specify an alternative printcap file.
#
 
;       load printers = yes
        cups options = raw
 
;       printcap name = /etc/printcap
        # obtain a list of printers automatically on UNIX System V systems:
;       printcap name = lpstat
;       printing = cups
 
# --------------------------- File System Options ---------------------------
#
# The options in this section can be un-commented if the file system supports
# extended attributes, and those attributes are enabled (usually via the
# "user_xattr" mount option). These options allow the administrator to specify
# that DOS attributes are stored in extended attributes and also make sure that
# Samba does not change the permission bits.
#
# Note: These options can be used on a per-share basis. Setting them globally
# (in the [global] section) makes them the default for all shares.
 
;       map archive = no
;       map hidden = no
;       map read only = no
;       map system = no
;       store dos attributes = yes
 
 
#============================ Share Definitions ==============================
 
[homes]
        comment = Home Directories
        browseable = yes
        writable = yes
;       valid users = %S
;       valid users = MYDOMAIN\%S
 
[printers]
        comment = All Printers
        path = /var/spool/samba
        browseable = no
;       guest ok = no
;       writable = no
        printable = yes
 
# Un-comment the following and create the netlogon directory for Domain Logons:
;       [netlogon]
;       comment = Network Logon Service
;       path = /var/lib/samba/netlogon
;       guest ok = yes
;       writable = no
;       share modes = no
 
# Un-comment the following to provide a specific roving profile share.
# The default is to use the user's home directory:
;       [Profiles]
;       path = /var/lib/samba/profiles
;       browseable = no
;       guest ok = yes
 
# A publicly accessible directory that is read only, except for users in the
# "staff" group (which have write permissions):
;       [public]
;       comment = Public Stuff
;       path = /home/samba
;       public = yes
;       writable = yes
 

Thank you for any help.

Last edited by degmic71 (2013-08-03 03:19:06)

Offline

#2 2013-08-05 00:21:02

degmic71
Member
Registered: 2009-02-03
Posts: 122

Re: Really noob issue with hostname (samba, hostname resolution)

Nothing????

Offline

#3 2013-08-05 00:49:48

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,612

Re: Really noob issue with hostname (samba, hostname resolution)

It depends on your router, and whether it is acting as a DNS server, and if it is keeping track of the hosts that are attaching to it and including its DHCP assignments in those DNS results.  Most consumer routers get a fail at this.  Part of the reason is that both Apple and Microsoft have their own independent means of doing local machine discovery.   I don't know what Microsoft calls their system this week, and I do not care.  Apple uses something called Bonjour.  To use Bonjour on Linux, you may want to look into Avahi.  Some distributions (Fedora?) support it out of the box.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB