[Samba] How to delete an unwanted NS record

Mani Wieser test_drive_123 at outlook.com
Wed Jul 8 07:50:34 UTC 2020


On 07.07.2020 22:14, Mani Wieser via samba wrote:
>
> On 07.07.2020 21:14, Rowland penny via samba wrote:
>> On 07/07/2020 20:00, James B. Byrne via samba wrote:
>>> I have this on the DC smb4-1.brockley.harte-lyne.ca:
>>>
>>> samba-tool dns query localhost brockley.harte-lyne.ca 
>>> brockley.harte-lyne.ca
>>> ALL -U administrator
>>> Password for [BROCKLEY\administrator]:
>>>    Name=, Records=6, Children=0
>>>      SOA: serial=7, refresh=900, retry=600, expire=86400, minttl=3600,
>>> ns=SMB4-1.brockley.harte-lyne.ca., email=support.harte-lyne.ca.
>>> (flags=600000f0, serial=110, ttl=3600)
>>>      NS: SMB4-1.brockley.harte-lyne.ca. (flags=600000f0, serial=110, 
>>> ttl=900)
>>>      NS: smb4-2.brockley.harte-lyne.ca. (flags=600000f0, serial=110, 
>>> ttl=900)
>>>      A: 192.168.18.161 (flags=600000f0, serial=110, ttl=900)
>>>      A: 192.168.18.162 (flags=600000f0, serial=110, ttl=900)
>>>      A: 192.168.216.162 (flags=600000f0, serial=110, ttl=900)
>>>    Name=_msdcs, Records=0, Children=0
>>>    Name=_sites, Records=0, Children=1
>>>    Name=_tcp, Records=0, Children=4
>>>    Name=_udp, Records=0, Children=2
>>>    Name=DomainDnsZones, Records=0, Children=2
>>>    Name=ForestDnsZones, Records=0, Children=2
>>>    Name=smb4-1, Records=1, Children=0
>>>      A: 192.168.18.161 (flags=f0, serial=110, ttl=900)
>>>    Name=SMB4-2, Records=2, Children=0
>>>      A: 192.168.18.162 (flags=f0, serial=110, ttl=900)
>>>      A: 192.168.216.162 (flags=f0, serial=110, ttl=900)
>>>
>>> 192.168.216.162 is an aliased IP on 192.168.18.162 which points to
>>> smb4-2.internal.harte-lyne.ca.
>>>
>>> host -t A smb4-2.internal.harte-lyne.ca
>>> smb4-2.internal.harte-lyne.ca has address 192.168.216.162
>>>
>>> host -t PTR 192.168.216.162
>>> 162.216.168.192.in-addr.arpa domain name pointer 
>>> smb4-2.internal.harte-lyne.ca.
>>>
>>> I can get rid of the A record, at least temporarily, with:
>>>
>>> samba-tool dns delete localhost brockley.harte-lyne.ca smb4-2 A 
>>> 192.168.216.162
>>> -U administrator
>>> Password for [BROCKLEY\administrator]:
>>> Record deleted successfully
>>>
>>>
>>> How do I get rid of the 192.168.216.162 NS record while leaving 
>>> 192.168.18.162?
>>>   I cannot determine the correct syntax for the 'samba-tool dns 
>>> delete' command.
>>>
>>>
>>> samba-tool dns delete localhost brockley.harte-lyne.ca @ NS
>>> smb4-2.internal.harte-lyne.ca
>>> Password for [administrator at BROCKLEY.HARTE-LYNE.CA]:
>>> 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)
>>>
>>>
>>> samba-tool dns delete localhost brockley.harte-lyne.ca @ NS 
>>> 192.168.216.162
>>> Password for [administrator at BROCKLEY.HARTE-LYNE.CA]:
>>> 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)
>>>
>> How many DC's do you have ?
>>
>> If it is two, SMB4-1 and smb4-2, then stop trying to remove smb4-2, 
>> it is a valid NS record, the only invalid record is the 
>> 192.168.216.162 A record.
>>
>> Rowland
>>
>>
>>
> I can't find any possibility to delete a NS record with samba-tool and 
> I would do it...to much typing ;-)
> have your tried the RSAT tools on a windows PC?
>
> I do this small changes in the DNS Manager
>
>
> Mani
>
Found it (while having my morning walk with the dog): same as with SOA: 
this is a zone/domain thing and not record

Usage: samba-tool dns delete <server> <zone> <name> 
<A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <data>
zone=domain
name=domain
data= FQDN of the server you want to delete

Usage: samba-tool dns add <server> <zone> <name> 
<A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <data>
same as above

Mani





More information about the samba mailing list