What I ended up doing, which worked for me, was make a change to 
nmbd_winsserver.c (samba 3.0.4)

I added:

                if(lp_dns_proxy() && (namerec->data.death_time != 
PERMANENT_TTL) && (namerec->data.death_time < p->timestamp) && 
((question->name_type == 0x20) || question->name_type == 0)) {
                        DEBUG(3,("wins_process_name_query: name query for 
name %s is expired - doing dns lookup.\n",
                                        nmb_namestr(question) ));

                        queue_dns_query(p, question, &namerec);
                        return;
                }

right above:

                if( (namerec->data.death_time != PERMANENT_TTL) && 
(namerec->data.death_time < p->timestamp) ) {
                        DEBUG(3,("wins_process_name_query: name query for 
name %s - name expired. Returning fail.\n",
                                        nmb_namestr(question) ));
                        send_wins_name_query_response(NAM_ERR, p, 
namerec);
                        return;
                }


I realize this is not likely the correct way to do it but it did work for 
me and got a lot of people off my back every morning when I came into work 
and they couldn't resolve names :)  By adding the above, the hosts in 
question would still expire after 2 hours but the next lookup after death 
would cause them to cache for another 2 hours instead of returning a fail 
message.

I will test your patch on samba-3.0.5pre1 (if I can remember how to diff 
:D) and report back.

____________________________________
Jeff Gerard - Systems Administrator
Wawanesa Mutual Insurance Company
Office: 204-985-0517
Fax:    204-947-5192
Email:  [EMAIL PROTECTED]




Jeremy Allison <[EMAIL PROTECTED]> 
28/06/2004 07:40 PM
Please respond to
Jeremy Allison <[EMAIL PROTECTED]>


To
Guillaume Millet <[EMAIL PROTECTED]>
cc
[EMAIL PROTECTED], [EMAIL PROTECTED]
Subject
Re: [Samba] Samba 3.0.3/4 - WINS server expires names after 2 hours






On Thu, Jun 24, 2004 at 04:25:52PM +0200, Guillaume Millet wrote:
> Hello,
> 
> I had the same problem.
> I've found a workaround by patching the code in 
"nmbd/nmbd_namelistdb.c":
> 
> /*******************************************************************
>  Expires old names in all subnet namelists.
> ******************************************************************/
> 
> void expire_names(time_t t)
> {
>        struct subnet_record *subrec;
> 
>        for( subrec = FIRST_SUBNET; subrec; subrec = 
>        NEXT_SUBNET_INCLUDING_UNICAST(subrec) ) {
>                expire_names_on_subnet( subrec, t );
>        }
> 
>        expire_names_on_subnet( wins_server_subnet, t ); /* ADD THIS LINE 

>        FOR REMOVING EXPIRED NAME FROM WINS TABLE */
> }
> 
> I dont know if it's the correct things to do, but it works fine for me 
> with my configuration (PDC+LDAP+WINS with Samba 3.0.4 on MDK 9.2)
> If a real Samba develloper can have a quick look to this to make a real 
> correction for next release.

Ok, I've looked at this in the current Samba 3.0.5preXX code (SVN) and
here is the fix I think should work. It forced DNS and DNSFAIL names to
be removed from the WINS db immediately their timeout persiod expires and
not to go into the "tombstoned" state (where they would hang around for
another day).

Let me know if this fixes the problem for you.

Thanks,

                 Jeremy.

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  http://lists.samba.org/mailman/listinfo/samba

Reply via email to