0

I have two laptops with ubuntu 13.10 x64 on them. I want both of them to be able to ping and mount one another via hostname or netbios name which is the same in my case. The computers are called gluk47-notebook and gluk47-pc (this is actually a 14'' laptop). The mystery is: the notebook pings the pc but not vice versa.

Here is what I have:

[root@gluk47-pc ~]# egrep '^hosts' /etc/nsswitch.conf 
hosts:          files wins dns mdns4
[root@gluk47-pc ~]# grep wins /etc/samba/smb.conf 
   wins support = yes
;   wins server = w.x.y.z
;   name resolve order = lmhosts host wins bcast
[root@gluk47-pc ~]# service winbind status
winbind start/running, process 1633
[root@gluk47-pc ~]# service smbd status
smbd start/running, process 712
[root@gluk47-pc ~]# smbtree -N
EARTH
        \\GLUK47-PC                     gluk47-pc server (Samba, Ubuntu)
                \\GLUK47-PC\print$              Printer Drivers
                \\GLUK47-PC\IPC$                IPC Service (gluk47-pc server (Samba, Ubuntu))
        \\GLUK47-NOTEBOOK               gluk47-notebook server (Samba, Ubuntu)
                \\GLUK47-NOTEBOOK\Home                  Домашний принтер
                \\GLUK47-NOTEBOOK\print$                Printer Drivers
                \\GLUK47-NOTEBOOK\software       
                \\GLUK47-NOTEBOOK\video          
                \\GLUK47-NOTEBOOK\IPC$                  IPC Service (gluk47-notebook server (Samba, Ubuntu))
[gluk47@gluk47-pc ~]$ ssh gluk47-notebook
ssh: Could not resolve hostname gluk47-notebook: Name or service not known

The answer of the address resolver is instant, unlike usual smb delays for every operation.

After that I ssh'ed directly by ip address and got the following from the notebook:

[root@gluk47-notebook ~]# egrep '^hosts' /etc/nsswitch.conf 
hosts:          files dns wins [NOTFOUND=return] mdns4_minimal mdns4
[root@gluk47-notebook ~]# grep wins /etc/samba/smb.conf
   wins support = yes
;   wins server = w.x.y.z
;   name resolve order = lmhosts host wins bcast
[root@gluk47-notebook ~]# service winbind status
winbind start/running, process 2381
[root@gluk47-notebook ~]# service smbd status
smbd start/running, process 23817
[root@gluk47-notebook ~]# smbtree -N
EARTH
        \\GLUK47-PC                     gluk47-pc server (Samba, Ubuntu)
                \\GLUK47-PC\print$              Printer Drivers
                \\GLUK47-PC\IPC$                IPC Service (gluk47-pc server (Samba, Ubuntu))
        \\GLUK47-NOTEBOOK               gluk47-notebook server (Samba, Ubuntu)
[root@gluk47-notebook ~]# smbclient -NL GLUK47-NOTEBOOK
Connection to GLUK47-NOTEBOOK failed (Error NT_STATUS_UNSUCCESSFUL)

This error is persistent and I'm stuck. What do I miss? Google is not my friend for this case so far :(

BTW if I place gluk47-notebook is /etc/hosts of the PC, everything works (I played a game on the pc via wine directly from a samba share of the notebook while writing this post), but I need dynamic netbios, not this statically hand-crafted hosts file... The pc cannot also ping other machines in the network by netbios name. Notebook pings them successfully. Other machines can ping both pc and notebook.

gluk47
  • 177

1 Answers1

4

Since you already knew about putting wins option into nsswitch.conf, I simply give you a direct answer here: You should additionally install package "libnss-winbind" so that your machine can resolve the name through WINS/NetBIOS. The package was installed automatically while winbind being installed on Ubuntu 13.04 and below.