Patch to samba_dnsupdate to support net ads dns register in self-test

Richard Sharpe realrichardsharpe at
Sun May 15 19:41:29 UTC 2016

On Sun, May 15, 2016 at 12:21 PM, Rowland Penny <repenny241155 at> wrote:
> On 15/05/16 19:54, Richard Sharpe wrote:
>> On Sun, May 15, 2016 at 11:26 AM, Rowland Penny <repenny241155 at>
>> wrote:
>>> On 15/05/16 19:22, Richard Sharpe wrote:
>>>> On Sun, May 15, 2016 at 11:18 AM, Rowland Penny
>>>> <repenny241155 at>
>>>> wrote:
>>>>> On 15/05/16 19:08, Richard Sharpe wrote:
>>>>>> On Sun, May 15, 2016 at 11:03 AM, Rowland Penny
>>>>>> <repenny241155 at>
>>>>>> wrote:
>>>>>>> On 15/05/16 18:41, Richard Sharpe wrote:
>>>>>>>> Hi folks,
>>>>>>>> Attached is a surprisingly simple patch to add an NS record to the
>>>>>>>> dns
>>>>>>>> file produced for self test.
>>>>>>>> There is another small change that is required in the file
>>>>>>>> to use this that I could merge with this patch if people desire.
>>>>>>>> However, first lets discuss this patch to see if it is the correct
>>>>>>>> way
>>>>>>>> to do this.
>>>>>>> Hi Richard, before I make myself look a fool (well a bigger fool than
>>>>>>> I
>>>>>>> already am ) by posting on list, is your patch doing the same as what
>>>>>>> this
>>>>>>> line would do in dns_update_list:
>>>>>>> ${HOSTNAME}
>>>>>> This is not a silly question at all, so I have added back
>>>>>> samba-technical.
>>>>>> 1. I do not know.
>>>>>> 2. I suspect that we do not want an NS record there, but if we do,
>>>>>> they it would be a simpler way to achieve what I am trying to do.
>>>>> Hi Richard,
>>>>> from my testing, it does need to be there and I sent a patch to add it,
>>>>> I
>>>>> then found that Andrew Bartlett has a similar patch with others he is
>>>>> working on. Because of this, my patch went nowhere, I didn't mind
>>>>> because
>>>>> at
>>>>> that time Andrew was working on a bigger problem which hopefully would
>>>>> have
>>>>> meant the internal DNS server would make use of the NS record that a
>>>>> secondary joined DC would add.
>>>>> This happened nearly six months ago and nothing has happened yet, if my
>>>>> (or
>>>>> Andrews similar) patch was added, each DC would have it is own SOA
>>>>> (like
>>>>> a
>>>>> Windows DC), but only if you use Bind9
>>>> Ahhh, this is useful info.
>>>> It seems that we need this for several reasons then :-)
>>>> I don't care whose patch makes it in. I simply care that it gets in.
>>> I agree with you, it needs to go in, but then we need to decide, does
>>> somebody fix the DNS server or do we tell everybody with more than one DC
>>> to
>>> use Bind9 ?
>> OK, so we need to figure out how to handle all the requirements.
>> That is, to be able to run these sorts of tests during self test, but
>> also to allow real environments to work.
>> In that case, for the sort-term, while we sort out the other issue,
>> perhaps we can take the approach I have taken.
> If I understand your patch correctly, the test is adding an ns record via
> samba_dnsupdate, much the same way as the script would do when 'samba' is
> started, so in this case, to get your test working, I would go with your
> patch.
> There is another side to this, if your test does work with your patch added,
> it then goes on to prove that either my patch (or Andrews) is needed.

My manual tests now work. That is, when I do the testenv thing and it
brings up an xterm, I can manually run:

    net ads dns register <name> <ip-addr> -Uxxx%password

and it succeeds and then run:

    net ads dns gethostbyname <dc-name> <name> -U etc

and it returns the address I registered.

Once this is resolved, I want to write tests.

Hmmm, I also need to test whether or not we can register names using
-P. That seemed to be the case and Windows does not allow that,
however, the problem may have been that due to the bugs I found it
looked like the registration succeeded when it did not.

Richard Sharpe

More information about the samba-technical mailing list