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

[Samba] Creating static WINS entries in Samba 4

822 views
Skip to first unread message

John Sanders

unread,
Feb 23, 2016, 7:00:04 PM2/23/16
to
Hi, This is a question regarding WINS in Samba 4

I need to add a permanent record to the WINS database in Samba

I'm using Samba 4.1.17+dfsg-2+deb8u1 in Debian 8

According to this document:

https://www.samba.org/samba/docs/man/Samba3-HOWTO/tdb.html

There are two files where the WINS records are stored:

wins.dat which is re-created upon restart, and wins.tdb which is meant to be the permanent database where static entries need to be declared.

Both files live in Debian at the directory "/var/lib/samba/"

In the web page referenced above it mentions explicitly about creating entries in wins.tdb:

""The working permanent storage for all WINS data. This database is used only when wins support = yes has been set in the smb.conf file. Note: This retains all manually configured WINS entries. Manual setting can be done use the net utility. ""

So here is the question: how does one create static WINS entries using the "net" utility???

I have spent quite some time online trying to find the answer, sadly Samba documentation is what it is right now, and I keep finding contradicting posts and old documents online that do not help me much to solve the mistery.

Can anybody help this poor soul? I would be eternally grateful. Regards :-)Turo Late
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

L.P.H. van Belle

unread,
Feb 24, 2016, 4:30:04 AM2/24/16
to

> So here is the question: how does one create static WINS entries using the
> "net" utility???

I suggest not, normaly dns is used for that, by the setting
"dns proxy = yes" ( the default )
But you must be sure your dns setup is good.

From man smb.conf
dns proxy (G)

Specifies that nmbd(8) when acting as a WINS server and finding that a
NetBIOS name has not been registered, should treat the NetBIOS name word-
for-word as a DNS name and do a lookup with the DNS server for that name on
behalf of the name-querying client.

Note that the maximum length for a NetBIOS name is 15 characters, so the DNS name (or DNS alias) can likewise only be 15 characters, maximum.

nmbd spawns a second copy of itself to do the DNS name lookup requests, as
doing a name lookup is a blocking action.

>> Default: dns proxy = yes
'

You can increase the WINS TTL if needed.
But normaly this is not needed.


Anyway, what im missing here, is, is this a ADDC or member server setup.
And which node type is set for the computers.

Often in dhcp is type H used. (hybrid) which tells the computer to do the NAME => Ip resolving by asking WINS first and then broadcast.

And remember, of needed to flush the local (PC) NetBios cache.
Check with nbtstat -c to see if its all correct.
nbtstat -R ( or nbtstat -RR ) to flush local cashe.

And editing tdb files ..
tdbtool --help



Greetz,

Louis





> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-...@lists.samba.org] Namens John Sanders
> Verzonden: woensdag 24 februari 2016 0:28
> Aan: sa...@lists.samba.org
> Onderwerp: [Samba] Creating static WINS entries in Samba 4

John Sanders

unread,
Feb 24, 2016, 9:10:05 AM2/24/16
to
> I suggest not, normaly dns is used for that, by the setting
> "dns proxy = yes"  ( the default )
> But you must be sure your dns setup is good.

I knew of that solution already, in fact I use it on my own network.

> Anyway, what im missing here, is, is this a ADDC or member server setup.
> And which node type is set for the computers.

Hi, perhaps I should have explained more of what I'm trying to achieve, here
it goes:

This is not for me, this is for an individual who refuses to accept the fact
that the old windows netbios way of finding computers on a network is
retarded beyond belief, so much that even microsoft has obsoleted it and
they themselves recommend people not to use it.

I tried to convince him to use a DNS server, but the person in particular
wants to have a working "network neighbourhood" environment on his network comprised
of two LANs with ~20 Windows clients and no Windows servers.

So a quick solution that requires little configuration is to use a standalone Samba server acting as a
WINS server.

If I added to the the DHCP server he uses in his network a WINS DHCP record
containing the address of the Samba server, so I can make each Windows computer
in the network use the samba box as the LMB/DMB automatically, that way there is no stupid
netbios broadcast, the browse list is always complete and the network
neighbourhood doesn't break when one switches a laptop or workstation off.

As stupid as it is, I have to admit that for what he wants (20 computers)
he's got a point, from his perspective his argument "in windows it just
works" is valid. There is next to nothing to configure when using a pure Windows
network workgroup, if there is a DHCP server "it just works"(TM).

So I thought it would be neat to show him some OSS beauty by setting a "PI"
running Linux and Samba, and show him a better way of doing it.

I have set this up already, for the most part it does work really well,
however I need to set a couple of static NETBIOS entries and that will be
the cherry on top.

I could always add entries to a common LMHOST file, publish it on
a Samba share and make each windows computer import it on its local LMHOSTS,
but this will not work with 3rd party laptops that come and go without
editing files on them. Also it is just ugly.

A DNS server is out of the question, I will have to manage it and A) I
refuse, B) it does add lots of complexity, because it will also need dynamic
dns registration. Using WINS works very well as a drop-in replacement.

I'm wondering if "Wins Proxy = yes" uses entries in the local hosts file of
the Samba server, that would be a neat way of adding static entries.

I will test that tonight.

> And editing tdb files ..
> tdbtool --help

I was afraid I would have to resort to that.

> Greetz,
> Louis

Thanks for your reply, much appreciated.
Regards :-)Turo Late

L.P.H. van Belle

unread,
Feb 24, 2016, 9:50:03 AM2/24/16
to
Ok... that make a lot clear..

Just follow this.
https://cumptrnrd.wordpress.com/2012/02/20/configuring-an-ubuntu-debian-server-for-dns-dhcp-and-wins/

It's what you want,.. almost/maybe not, but read through it,
you see why i pointed this out for you.

Yes, it does contain dhcp and dns (ddns) , but this setup is rock stable.
It wil make your life more easy.

Then done, add the following in the dhcp options
( and yes, 2 x same IP here if you have 1 server!! )
(Replace the IP with the ip of your PI.)
netbios-name-servers 192.168.0.1, 192.168.0.1;
option netbios-node-type 8;

so no need for lmhosts to maintain, import/exports, unsupported, outdated. Etc. This is a "set and forget" in my opinion.

I run this setup at about 4 home networks, exact like above.
You can even setup the unattended-upgrades, well, at least i did.
I had 1 problem in the last 4-5 years.. ( disk broke ) ;-)


Greetz,

Louis


> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-...@lists.samba.org] Namens John Sanders
> Verzonden: woensdag 24 februari 2016 14:57
> Aan: sa...@lists.samba.org
> Onderwerp: [Samba] Creating static WINS entries in Samba 4
>
0 new messages