# [Samba] WINS problems, nmblookup working, ping not

## Sade

Hi,

I can't get my grips around Samba and WINS. I never fully understood it, but it worked, and now i have a new server, performed a new install and it doesn't work.

so the setup:

Fileserver:

OS: Gentoo 

hostname: atom

Samba Version: 3.0.33

This should be the WINS server

```
atom j # hostname

atom
```

Other PC:

OS: XP

hostname: media

The problem:

nmblookup works:

```

atom j # nmblookup -R -U localhost media

querying media on 127.0.0.1

192.168.1.105 media<00>
```

smbclient works:

```
atom j # smbclient -L media -R wins

Password:

Domain=[MEDIA] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment

        ---------       ----      -------

  blablabla
```

but a ping doesn't:

```
atom j # ping -c 3 media

ping: unknown host media

atom j # ping -c 3 //media

ping: unknown host //media
```

And therefore mounting based on netbios doesn't work.

All my windows boxes can find my server (and aliasses) fine. (I've told my router to spread the word about the WINS server). Only my server seems to have problems.

A snippet out of my smb.conf

```
[global]

workgroup = WORKGROUP

netbios name = server

netbios aliases = atom en

unix extensions = no

wins support = yes

local master = yes

os level = 99

domain master = yes

preferred master = yes

lm announce = yes

lm interval = 60

name resolve order = wins lmhosts hosts bcast
```

and my /etc/nsswitch.conf

```
atom j # cat /etc/nsswitch.conf | grep wins

hosts:       files dns wins nis

networks:    files dns wins nis
```

TIA

----------

## audiodef

I don't have the answer directly, but I noticed the thread title and wanted to say perhaps 

http://www.gentoo.org/doc/en/quick-samba-howto.xml

might be helpful. I don't need very much from samba, but I find this guide helps when I need to set up or change something and I get lost.

----------

## Sade

Thanks for the pointer to the howto,

I rechecked all my settings according to it, and the only things i had different where use flags for kerberos and winbind.

I'm recompiling packages with use flag changes now.

Also while googling some more i've found this:

[Samba] unable to ping windows hosts by hostname

He solved the problem, but i can't. Man there are a lot of topic floating around about this subject, too bad none helped me so far.

----------

## Sade

Bump,

----------

## Sade

bump

----------

## danomac

Is winbindd running? It's the only thing I can think of...

```

$ ps aux | grep winbind

```

It doesn't start by default. You have to tell the initscripts to start it.

----------

## Sade

I'm sorry for the late response, i kinda lost hope on this thead.

I've checked the ps, and winbind is not running,

But i thought that winbind was for connecting to a windows domain, to use AD an such.

I only want hostname recognition, wins should be working without winbind right?

Anyway when i start winbind using /etc/conf.d/samba my network shares stop working, so i guess it needs more configuring.

https://forums.gentoo.org/viewtopic-t-363736-highlight-init+d+winbind.html

----------

## stychokiller

I had the same problem.  I fixed my setup by changing the following in /etc/nsswitch.conf:

from:

#hosts:       files mdns dns wins

to:

hosts:       files wins dns

The file used to have the commented-out line in it, but changing the order of wins and dns fixed

everything.  Of course, one of the PCs is also running winbindd.

According to WireShark, ping was trying to find the IP of one of the local PCs in our 

house by asking the ISP for the IP, and of course the ISP would respond with some bogus IP.

217.138.137.24 or something like that.  Hope this can fix your problem also.

Jim

----------

