Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resolving NETBIOS names

631 views
Skip to first unread message

The Real Doctor

unread,
Apr 26, 2013, 3:47:47 PM4/26/13
to
People

I would like to resolve devices by NETBIOS Name. After a bit of
googling, I changed /etc/nsswitch.conf to include

hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns4

and /etc/samba/smb.conf to include

wins support = yes

then restarted the samba server, but ping <name> still gives

ping: unknown host <Name>

I must be missing something, and it's probably something simple. Can
anyone give me a clue?

Ian

Brian Reay

unread,
Apr 27, 2013, 4:15:46 PM4/27/13
to
On 26/04/2013 20:47, The Real Doctor wrote:
> People
>
> I would like to resolve devices by NETBIOS Name. After a bit of
> googling, I changed /etc/nsswitch.conf to include
>
> 4hosts: files wins mdns4_minimal [NOTFOUND=return] dns mdns
>
> and /etc/samba/smb.conf to include
>
> wins support = yes
>
> then restarted the samba server, but ping <name> still gives
>
> ping: unknown host <Name>
>
> I must be missing something, and it's probably something simple. Can
> anyone give me a clue?
>
> Ian

Hmm, that isn't how I normally modify /etc/nsswitch.conf to achieve the
same thing.

I normally insert wins before dns ie:

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4

For smb.conf, I add:


netbios name = YOURHOSTNAME


After the workgroup= line

I assume you've installed winbind ?

(If not, sudo apt-get install winbind and either restart networking or
reboot.)

Those steps always seem to work for me when I have issues with Samba and
Netbios



The Real Doctor

unread,
Apr 28, 2013, 5:52:04 AM4/28/13
to
On 27/04/13 21:15, Brian Reay wrote:
> Those steps always seem to work for me when I have issues with Samba and
> Netbios

Thanks for the advice. I have modified /etc/nsswitch.conf and
/etc/samba/smb.conf as you suggest, checked that winbind is installed
and rebooted, but the problem persists. Most baffling.

Ian

Chris Davies

unread,
Apr 28, 2013, 10:23:22 AM4/28/13
to
The Real Doctor <ian.g...@btinternet.com> wrote:
> Thanks for the advice. I have modified /etc/nsswitch.conf and
> /etc/samba/smb.conf as you suggest, checked that winbind is installed
> and rebooted, but the problem persists. Most baffling.

This has just worked for me on a Debian system (no reboot required):

1. Install winbind (and associated dependencies, which included samba)
2. Added the Debian system to the local WORKGROUP
2. Edited /etc/nsswitch.conf such that hosts included wins:
hosts: files dns wins

If I recall correctly, it won't work as simply as this for a system
within an Active Directory environment.

Chris

Brian Reay

unread,
Apr 28, 2013, 5:47:05 PM4/28/13
to
Hmm, most odd, esp. after Chris's similar comments to mine.

What is happens when you try to 'ping' the host?

The Real Doctor

unread,
Apr 28, 2013, 6:26:26 PM4/28/13
to
On 28/04/13 22:47, Brian Reay wrote:
>
> Hmm, most odd, esp. after Chris's similar comments to mine.
>
> What is happens when you try to 'ping' the host?

ian@kookaburra:~$ ping wombat
ping: unknown host wombat

It (a NAS box) responds just fine if I ping its IP address and I have
shares from it mounted no problem, which I presume means that both
machines think they're in the same workgroup.

Ian

Martin Gregorie

unread,
Apr 28, 2013, 7:09:54 PM4/28/13
to
It looks as though you need to associate wombat's host name with its IP
and store that info somewhere that's accessible to the other machines
that need to refer to it by its hostname. Your options are:

1)add the information to /etc/hosts on all the machines that need to
talk to it

2)add the information to your DHCP server's configuration

3)add the information to the zone files for your LAN in your local
DNS server.

How is 'wombat's IP assigned to it?

If its a dynamically assigned IP obtained via DHCP, you might be able to
configure your DHCP server to assign it a hostname as well as an IP.
You'll need to know its Ethernet interface's MAC for that to work (lshw
can tell you that - the MAC is labelled 'serial' in its output). If your
DHCP server doesn't have this ability, then consider using a static IP.

If you're using static IPs on your LAN, then you need to add a line to
/etc/hosts on all the machines that need to connect to it.
This line gives its IP and host name. "man hosts" tells all.
Alternatively, if you're running a local DNS, add an entry for wombat to
the zone files that describe your LAN.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |

The Real Doctor

unread,
Apr 29, 2013, 4:32:54 AM4/29/13
to
On 29/04/13 00:09, Martin Gregorie wrote:
> How is 'wombat's IP assigned to it?

"wombat" (name changed to protect the innocent) has a static IP address.
Dynamic addresses on the network are allocated by my router, a bog
standard DG834G, which alas does not include a dns server. I certainly
can add wombat to /etc/hosts files, but I'd prefer a more automatic
solution if possible.

Ian

Tony Houghton

unread,
Apr 29, 2013, 8:40:29 AM4/29/13
to
On Mon, 29 Apr 2013 09:32:54 +0100
The Real Doctor <ian.g...@btinternet.com> wrote:

Do you have a mixed Windows/Linux network or just Linux? You could use
avahi and refer to wombat.local etc. It might work on Windows too if you
install Apple's Bonjour, but I don't know whether that integrates with
the entire system or just Apple software. Some people hate
avahi/zeroconf though.

Chris Davies

unread,
Apr 29, 2013, 4:06:39 PM4/29/13
to
The Real Doctor <ian.g...@btinternet.com> wrote:
> I would like to resolve devices by NETBIOS Name. After a bit of
> googling, I changed [...]

> /etc/samba/smb.conf to include
> wins support = yes

No, no, no!

Turn this back off again, and (re)read the manpage to see what it does!
Chris

alexd

unread,
Apr 29, 2013, 4:29:49 PM4/29/13
to
Chris Davies (for it is he) wrote:

> If I recall correctly, it won't work as simply as this for a system
> within an Active Directory environment.

No, it's simpler - AD includes DNS.

--
<http://ale.cx/> (AIM:troffasky) (UnSoEs...@ale.cx)
21:29:25 up 45 days, 12:25, 5 users, load average: 0.02, 0.18, 0.26
Qua illic est reprehendit, illic est a vindicatum

Martin Gregorie

unread,
Apr 29, 2013, 4:41:18 PM4/29/13
to
I initially used /etc/hosts, but fairly quickly switched over to running
named as soon as my LAN extended to more than two hosts. I prefer to
convenience of only having one set of zone files to keeping separate
hosts files for each host.

From time to time I consider installing a DHCP server on my house server,
but so far I've just lain down until the idea has gone away and my LAN
remains entirely statically addressed.

The Real Doctor

unread,
Apr 29, 2013, 4:59:24 PM4/29/13
to
On 29/04/13 21:41, Martin Gregorie wrote:
> I initially used /etc/hosts, but fairly quickly switched over to running
> named as soon as my LAN extended to more than two hosts. I prefer to
> convenience of only having one set of zone files to keeping separate
> hosts files for each host.

I used to have a wired router which did DNS, and that was great, Static
addresses for all my stuff (and DHCP for visitors) but only one set of
allocations to keep current. I'm surprised that more routers don't have
that option, as it seems like an obvious feature to include.

I use cheap DG834Gs because the local telephone exchange is on a hill
and gets struck by lightning every year or so. When that happen, my
router gets fried, so I keep a spare (ten quid on eBay is my limit)
flashed to my config an ready to drop in. Downtime after a lightning
strike is generally about 1 minute to diagnose the problem and 1 minute
to rectify it.

> From time to time I consider installing a DHCP server on my house server,
> but so far I've just lain down until the idea has gone away and my LAN
> remains entirely statically addressed.

The only things which are on all the time here are the nice new Zyxel
NAS box and the ancient but utterly reliable JetDirect 3EX printer
server, which has been running continuously and without problems (like
the LaserJet 1100 to which it is attached) for around ten years, and
neither of them will run a DNS server. I suppose I could add a Raspberry
Pi, but it seems a complicated solution when, apparently, resolving
netbios names should just work. Dammit.

Ian

The Real Doctor

unread,
Apr 29, 2013, 5:07:15 PM4/29/13
to
I was only doing what some bloke on Google said. In the file itself it says

# WINS Support - Tells the NMBD component of Samba to enable its WINS Server

Now turned off, and makes no difference. Mind you, turning it on made no
difference either.

If I need wins in nsswitch.conf to resolve netbios names, don't I need a
wins server somewhere? I have managed thus far to stay blissful ignorant
of windows networking issues.

Ian

Message has been deleted

Martin Gregorie

unread,
Apr 29, 2013, 5:33:09 PM4/29/13
to
On Mon, 29 Apr 2013 21:19:17 +0000, Huge wrote:

> I run a SmoothWall, which as well as acting as a firewall, also runs
> DHCP and a DNS masquerade program (dnsmasq) which "looks" like a named
> server but is much easier to maintain for a small home network. I
> maintain one hosts file on the Smoothwall and although I hand out IP
> addresses via DHCP, anything that needs a fixed IP address gets it. It's
> easy to maintain via the Smoothwall web interface. (At least the DHCP is
> - you still need to log on and edit the hosts file by hand).
>
Actually, I'm doing much the same.

My home server (a used twin Athlon at a nice price) runs BIND as
previously described - including LJ5 and RPi supporting 7 boxes including
the ADSL router's static gateway address) and, since I recently added a
SamKnows TP-Link line test box which is dynamic-IP only, I persuaded my
ancient Solwise ADSL router to run a DHCP server just to keep the TP-Link
happy, though it also comes in handy for visitors.

Chris Davies

unread,
Apr 30, 2013, 2:15:40 AM4/30/13
to
You don't need (or want) a Wins server - that's a service that claims
naming authority for all your machines on your network. If you have no
authoritative Wins server then the remaining machines will pool
their knowledge and elect a master server between them. Typically,
a Domain Controller from an Active Directory configuration would be an
authoritative Wins server.

Chris

c...@isbd.net

unread,
Apr 30, 2013, 6:56:36 AM4/30/13
to
The Real Doctor <ian.g...@btinternet.com> wrote:
I use dnsmasq for just this situation.

I have a small server system running all the time (it could also be the
backup system but that's actually separate) which runs dnsmasq and a
Draytek Vigor router which, like yours, doesn't provide local DNS.

The server running at 192.168.1.2 provides both DNS and DHCP so that
client systems (if they're well behaved) provide it with their name as
well as getting assigned an IP address. The dnsmasq in the server then
provides local DNS for the whole LAN and forwards other requests to the
upstream DNS at my ISP.

dnsmasq works virtually 'out of the box' with very little configuration
but has *lots* of extras if you need them. It can handle systems on the
LAN which need a static address by various means, you can simply put
them in the /etc/hosts and dnsmasq will provide DNS of their names from
there or you can lock an IP address to a MAC address in the dnsmasq
configuration so that dnsmasq gives the system its 'static' IP when it
starts up and uses DHCP.

--
Chris Green
Message has been deleted

Brian Reay

unread,
May 1, 2013, 5:33:48 PM5/1/13
to
The 'easy' automatic way (which the 834 will do, I used it, and I'd be
surprised if other routers don't) is a mixed set up.

Run DHCP, but allocate 'fixed' addresses to fixed devices. I have a
system- machines in a block, printers in a block, network HW in a block,
another, free, block which is the DHCP pool.






The Real Doctor

unread,
May 1, 2013, 6:05:37 PM5/1/13
to
On 30/04/13 22:22, Huge wrote:
> On 2013-04-30, c...@isbd.net <c...@isbd.net> wrote:

>> I use dnsmasq ...
>
> Strongly recommended!

I've used it myself for network boots and found it very satisfactory.
However, as I wrote somewhere, the only things I have running all the
time are a Zyxel NAS box and an ancient HP print server, and neither of
them runs DNSMasq ...

Ian


Message has been deleted
0 new messages