[Samba] How to delete an unwanted NS record

James B. Byrne byrnejb at harte-lyne.ca
Wed Jul 8 15:52:22 UTC 2020


On Wed Jul 8 13:46:41 UTC 2020, Rowland penny wrote:
>
> This is because it is an 'A' record and not an 'NS' record.

samba-tool dns delete localhost brockley.harte-lyne.ca brockley.harte-lyne.ca.
A 192.168.216.162 -U administrator
Password for [BROCKLEY\administrator]:
ERROR(runtime): uncaught exception - (9701,
'WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST')
  File "/usr/local/lib/python3.7/site-packages/samba/netcmd/__init__.py", line
185, in _run
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/samba/netcmd/dns.py", line 1071,
in run
    raise e
  File "/usr/local/lib/python3.7/site-packages/samba/netcmd/dns.py", line 1067,
in run
    del_rec_buf)

Clearly not.  Removing the unwanted 'A 192.168.216.162' resource record worked
the first time.  It probably was a mistake on my part to do so but, it worked. 
What is left is the NS artifact of the first join of smb4-2.

  Name=, Records=4, Children=0
    SOA: serial=19, refresh=900, retry=600, expire=86400, minttl=3600,
ns=SMB4-1.brockley.harte-lyne.ca., email=support.harte-lyne.ca.
(flags=600000f0, serial=19, ttl=3600)
    NS: SMB4-1.brockley.harte-lyne.ca. (flags=600000f0, serial=110, ttl=900)
    A: 192.168.18.161 (flags=600000f0, serial=110, ttl=900)
    A: 192.168.216.162 (flags=600000f0, serial=110, ttl=900)

An A record entry would look like this:

  Name=smb4-2, Records=1, Children=0
    A: 192.168.216.162 (flags=f0, serial=110, ttl=900)

But there is none.


In a BIND hosts file the name service header given above would look like this:

$TTL 900

;IN SOA hostname email serial refresh retry expire TTL
SMB4-1.brockley.harte-lyne.ca.  IN  SOA brockley.harte-lyne.ca.
support.harte-lyne.ca. (
      19
      900
      600
      86400
      3600 )
;# Registered Name Servers
            IN  NS  192.168.18.161
            IN  NS  192.168.216.162

In this set up all I need do is delete the line 'IN  NS  192.168.216.162',
change the serial number (19=>20), and rndc reload.

I am finding it difficult to understand why making this trivial change is so
convoluted in Samba. I thought that my use of the syntax for samba-tool dns
delete was correct but it could not find an NS record with the argument
192.168.216.162. And yet one clearly exists.

Of course, now I have other problems stemming from my awkward attempts to solve
this issue.

Sincerely,

-- 
***          e-Mail is NOT a SECURE channel          ***
        Do NOT transmit sensitive data via e-Mail
   Unencrypted messages have no legal claim to privacy
 Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne                mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3




More information about the samba mailing list