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

[Samba] Phantom DNS records visible with dig, but not samba-tool dns

500 views
Skip to first unread message

ash-samba--- via samba

unread,
Sep 9, 2016, 11:10:05 AM9/9/16
to
We appear to have some phantom DNS records on both our domain controllers.

We can see the records using "dig", but not with samba-tool. We can't remove the records either.

(v-ward and v-fief are the DCs, Hawaii and Alaska are old DCs which were demoted without errors, I'm trying to clean up some DNS records which don't seem to have been cleaned).

All machines are 4.2.10-Debian

Can anybody advise how I can fix this? Ideally in this case there would only be two records.

Console output follows

Thanks,



root@v-ward# samba-tool dns query v-ward _msdcs.chester-dc.example.com _ldap._tcp.dc srv
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
Name=, Records=3, Children=0
SRV: HAWAII.chester-dc.example.com. (389, 0, 100) (flags=f0, serial=110, ttl=900)
SRV: ALASKA.chester-dc.example.com. (389, 0, 100) (flags=f0, serial=110, ttl=900)
SRV: v-fief.chester-dc.example.com. (389, 0, 100) (flags=f0, serial=110, ttl=0)

root@v-ward# samba-tool dns delete v-ward _msdcs.chester-dc.example.com _ldap._tcp.dc srv "v-ward.chester-dc. 389 0 100"
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
ERROR: Record does not exist

#(10.4.4.155 is samba on v-ward)
# dig _ldap._tcp.dc._msdcs.chester-dc.example.com srv @10.4.4.155

; <<>> DiG 9.9.5-9+deb8u4-Debian <<>> _ldap._tcp.dc._msdcs.chester-dc.example.com srv @10.4.4.155
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14081
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;_ldap._tcp.dc._msdcs.chester-dc.example.com. IN SRV

;; ANSWER SECTION:
_ldap._tcp.dc._msdcs.chester-dc.example.com. 900 IN SRV 0 100 389 HAWAII.chester-dc.example.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 900 IN SRV 0 100 389 ALASKA.chester-dc.example.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389 v-fief.chester-dc.example.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389 v-ward.chester-dc.example.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389 v-ward.chester-dc.co.uk.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389 v-ward.chester-dc.

;; Query time: 0 msec
;; SERVER: 10.4.4.155#53(10.4.4.155)
;; WHEN: Fri Sep 09 15:38:48 BST 2016
;; MSG SIZE rcvd: 245

# testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[netlogon]"
Processing section "[sysvol]"
Loaded services file OK.
Server role: ROLE_ACTIVE_DIRECTORY_DC

Press enter to see a dump of your service definitions

# Global parameters
[global]
workgroup = CHESTER-DC
realm = CHESTER-DC.EXAMPLE.COM
server role = active directory domain controller
passdb backend = samba_dsdb
log file = /var/log/samba/log.%m
max log size = 1000
client ldap sasl wrapping = plain
ldap server require strong auth = No
load printers = No
cups server = printers.example.com
panic action = /usr/share/samba/panic-action %d
dns forwarder = 10.4.4.10
rpc_server:tcpip = no
rpc_server:winreg = embedded
rpc_server:ntsvcs = embedded
rpc_server:eventlog = embedded
rpc_server:srvsvc = embedded
rpc_server:svcctl = embedded
rpc_server:default = external
winbindd:use external pipes = true
acl:read = false
rpc_daemon:spoolssd = embedded
rpc_server:spoolss = embedded
idmap config chester-dc : range = 1000-999999
idmap config chester-dc : backend = ad
idmap config * : range = 1000000-1999999
idmap_ldb:use rfc2307 = yes
idmap config * : backend = tdb
map archive = No
map readonly = no
store dos attributes = Yes
include = /etc/samba/smb.common
vfs objects = dfs_samba4 acl_xattr



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

lingpanda101--- via samba

unread,
Sep 9, 2016, 11:40:03 AM9/9/16
to
For me I had to use ADSI edit to remove the entries.

--
-James

ash-samba--- via samba

unread,
Sep 12, 2016, 3:30:03 PM9/12/16
to
On 09/09/16 16:35, lingpanda101--- via samba wrote:
> On 9/9/2016 10:59 AM, ash-samba--- via samba wrote:
>> We appear to have some phantom DNS records on both our domain
>> controllers.
>> [...]
>> # dig _ldap._tcp.dc._msdcs.chester-dc.example.com srv @10.4.4.155
>> [...]
>>
>
> For me I had to use ADSI edit to remove the entries.
>
I've managed to locate the entries using ADSI edit ( for any future
archive readers, open ADSI edit, and then connect using
"DC=ForestDCZones,dc=chester-dc,dc=example,dc=com" as the naming
context, the records are under CN=MicrosoftDNS).

The thing is, if I open, say DC=_ldap._tcp.dc and then look at dnsRecord
the entries are using some kind of encoding (a series of backslash
prefixed 2 digit hex values).

I'm unsure which records to delete, and I'm somewhat concerned about
experimenting since I can't clearly tell what is going on with the
regular tools (AD DNS/samba-tool). A possibly greater problem is that I
can't actually search to see which records need modification.

Will there be any impact if I just leave the corrupt records in place?

Are there any tools to automate fixing things?

Thanks,

lingpanda101--- via samba

unread,
Sep 12, 2016, 3:40:03 PM9/12/16
to
On 9/12/2016 3:23 PM, ash-samba--- via samba wrote:
> On 09/09/16 16:35, lingpanda101--- via samba wrote:
>> On 9/9/2016 10:59 AM, ash-samba--- via samba wrote:
>>> We appear to have some phantom DNS records on both our domain
>>> controllers.
>>> [...]
>>> # dig _ldap._tcp.dc._msdcs.chester-dc.example.com srv @10.4.4.155
>>> [...]
>>>
>>
>> For me I had to use ADSI edit to remove the entries.
>>
> I've managed to locate the entries using ADSI edit ( for any future
> archive readers, open ADSI edit, and then connect using
> "DC=ForestDCZones,dc=chester-dc,dc=example,dc=com" as the naming
> context, the records are under CN=MicrosoftDNS).
>
> The thing is, if I open, say DC=_ldap._tcp.dc and then look at dnsRecord
> the entries are using some kind of encoding (a series of backslash
> prefixed 2 digit hex values).
>
> I'm unsure which records to delete, and I'm somewhat concerned about
> experimenting since I can't clearly tell what is going on with the
> regular tools (AD DNS/samba-tool). A possibly greater problem is that I
> can't actually search to see which records need modification.
>
> Will there be any impact if I just leave the corrupt records in place?
>
> Are there any tools to automate fixing things?
>
> Thanks,
>
>
>

I assume you made a typo? Shouldn't it be
'DC=ForestDNSZones,dc=domain,dc=com'? Can you copy and paste exactly
what the record looks like?

I wouldn't delete anything unless absolutely sure.

--
-James

lingpanda101--- via samba

unread,
Sep 12, 2016, 3:50:03 PM9/12/16
to
On 9/12/2016 3:23 PM, ash-samba--- via samba wrote:
> On 09/09/16 16:35, lingpanda101--- via samba wrote:
>> On 9/9/2016 10:59 AM, ash-samba--- via samba wrote:
>>> We appear to have some phantom DNS records on both our domain
>>> controllers.
>>> [...]
>>> # dig _ldap._tcp.dc._msdcs.chester-dc.example.com srv @10.4.4.155
>>> [...]
>>>
>>
>> For me I had to use ADSI edit to remove the entries.
>>
> I've managed to locate the entries using ADSI edit ( for any future
> archive readers, open ADSI edit, and then connect using
> "DC=ForestDCZones,dc=chester-dc,dc=example,dc=com" as the naming
> context, the records are under CN=MicrosoftDNS).
>
> The thing is, if I open, say DC=_ldap._tcp.dc and then look at dnsRecord
> the entries are using some kind of encoding (a series of backslash
> prefixed 2 digit hex values).
>
> I'm unsure which records to delete, and I'm somewhat concerned about
> experimenting since I can't clearly tell what is going on with the
> regular tools (AD DNS/samba-tool). A possibly greater problem is that I
> can't actually search to see which records need modification.
>
> Will there be any impact if I just leave the corrupt records in place?
>
> Are there any tools to automate fixing things?
>
> Thanks,
>
>
>

I see what you mean by the value of DNS. That's normal. It's in hexadecimal.

--
-James

Rowland Penny via samba

unread,
Sep 12, 2016, 4:00:03 PM9/12/16
to
Not if you you know what tool to use, where to use it and the magic
incantation ;-)

# editing 1 records
# record 1
dn: DC=_ldap._tcp.pdc,DC=_msdcs.samdom.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=samdom,DC=example,DC=com
objectClass: top
objectClass: dnsNode
instanceType: 4
whenCreated: 20151106115626.0Z
whenChanged: 20151106115626.0Z
uSNCreated: 3683
uSNChanged: 3683
showInAdvancedViewOnly: TRUE
name: _ldap._tcp.pdc
objectGUID: 77be2b80-e5c7-46bb-a410-7d7c5c02efa7
dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x0020 (32)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_ZONE (240)
flags : 0x0000 (0)
dwSerial : 0x00000001 (1)
dwTtlSeconds : 0x00000384 (900)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x00000000 (0)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : dc1.samdom.example.com

objectCategory: CN=Dns-Node,CN=Schema,CN=Configuration,DC=samdom,DC=example,DC=com
dc: _ldap._tcp.pdc
distinguishedName: DC=_ldap._tcp.pdc,DC=_msdcs.samdom.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=samdom,DC=example,DC=com

And to get it editable:

ldbedit -e nano -H /usr/local/samba/private/sam.ldb --cross-ncs
--show-binary -b
'DC=_ldap._tcp.pdc,DC=_msdcs.samdom.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=samdom,DC=example,DC=com'
-s base

All on one line, run on a DC.

Rowland

ash-samba--- via samba

unread,
Sep 12, 2016, 4:30:03 PM9/12/16
to
On 12/09/16 20:47, Rowland Penny via samba wrote:
> On Mon, 12 Sep 2016 15:41:24 -0400
> lingpanda101--- via samba <sa...@lists.samba.org> wrote:
>
>> On 9/12/2016 3:23 PM, ash-samba--- via samba wrote:
>>> On 09/09/16 16:35, lingpanda101--- via samba wrote:
>>>> On 9/9/2016 10:59 AM, ash-samba--- via samba wrote:
>>>>> We appear to have some phantom DNS records on both our domain
[...]
>>>>> And to get it editable:
>>>>>
>>>>> ldbedit -e nano -H /usr/local/samba/private/sam.ldb --cross-ncs
>>>>> --show-binary -b
>>>>> 'DC=_ldap._tcp.pdc,DC=_msdcs.samdom.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=samdom,DC=example,DC=com'
>>>>> -s base
>>>>>
>>>>> All on one line, run on a DC.
>>>>>
>>>>> Rowland
>>>>>

Okay, thanks.

I'd love to know how it got into this state, though.

The idea of tampering with a potentially corrupt AD scares me; I think
perhaps I'm going to snapshot the domain controllers before I do it!

ash-samba--- via samba

unread,
Sep 13, 2016, 10:30:03 AM9/13/16
to
> And to get it editable:
>
> ldbedit -e nano -H /usr/local/samba/private/sam.ldb --cross-ncs
> --show-binary -b
> 'DC=_ldap._tcp.pdc,DC=_msdcs.samdom.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=samdom,DC=example,DC=com'
> -s base
>
> All on one line, run on a DC.
>
> Rowland
The problem is that when I save and exit (even if I make no ldif
changes), I get:

Error: First line of ldif must be a dn not 'dnsRecord'

I get this even if I'm editing a seemingly valid DNS record.

The broken record is:

# editing 1 records
# record 1
dn: DC=_ldap._tcp.dc,DC=_msdcs.chester-dc.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=chester-dc,DC=example,DC=com
objectClass: top
objectClass: dnsNode
instanceType: 4
whenCreated: 20140528144629.0Z
uSNCreated: 18305
showInAdvancedViewOnly: TRUE
name: _ldap._tcp.dc
objectGUID: bf3c8f60-48d9-43d4-a6a3-d724352ae8e9
objectCategory: CN=Dns-Node,CN=Schema,CN=Configuration,DC=chester-dc,DC=example,DC=com
dc: _ldap._tcp.dc
dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x0028 (40)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_ZONE (240)
flags : 0x0000 (0)
dwSerial : 0x0000006e (110)
dwTtlSeconds : 0x00000384 (900)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x00000000 (0)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : HAWAII.chester-dc.example.com

dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x0028 (40)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_ZONE (240)
flags : 0x0000 (0)
dwSerial : 0x0000006e (110)
dwTtlSeconds : 0x00000384 (900)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x00000000 (0)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : ALASKA.chester-dc.example.com

dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x0028 (40)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_ZONE (240)
flags : 0x0000 (0)
dwSerial : 0x0000006e (110)
dwTtlSeconds : 0x00000000 (0)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x00378ff8 (3641336)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : v-fief.chester-dc.example.com

dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x0028 (40)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_NONE (0)
flags : 0x0000 (0)
dwSerial : 0x0000006e (110)
dwTtlSeconds : 0x00000000 (0)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x0d5895fd (223909373)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : v-ward.chester-dc.example.com

dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x0021 (33)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_NONE (0)
flags : 0x0000 (0)
dwSerial : 0x0000006e (110)
dwTtlSeconds : 0x00000000 (0)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x0de21bb2 (232922034)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : v-ward.chester-dc.co.uk

dnsRecord: NDR: struct dnsp_DnssrvRpcRecord
wDataLength : 0x001b (27)
wType : DNS_TYPE_SRV (33)
version : 0x05 (5)
rank : DNS_RANK_NONE (0)
flags : 0x0000 (0)
dwSerial : 0x0000006e (110)
dwTtlSeconds : 0x00000000 (0)
dwReserved : 0x00000000 (0)
dwTimeStamp : 0x0de21c35 (232922165)
data : union dnsRecordData(case 33)
srv: struct dnsp_srv
wPriority : 0x0000 (0)
wWeight : 0x0064 (100)
wPort : 0x0185 (389)
nameTarget : v-ward.chester-dc

whenChanged: 20160908160654.0Z
uSNChanged: 33473
distinguishedName: DC=_ldap._tcp.dc,DC=_msdcs.chester-dc.example.com,CN=MicrosoftDNS,DC=ForestDnsZones,DC=chester-dc,DC=example,DC=com

Rowland Penny via samba

unread,
Sep 13, 2016, 11:10:04 AM9/13/16
to
Now you have identified what the records, you should be able to remove
the required records with samba-tool, for instance, if you wanted to
remove the record for ' HAWAII', try this:

samba-tool dns delete 127.0.0.1 _msdcs.chester-dc.example.com
_ldap._tcp.dc SRV 'HAWAII.chester-dc.example.com 389 0 100'

Rowland

ash-samba--- via samba

unread,
Sep 13, 2016, 11:50:03 AM9/13/16
to
> Now you have identified what the records, you should be able to remove
> the required records with samba-tool, for instance, if you wanted to
> remove the record for ' HAWAII', try this:
>
> samba-tool dns delete 127.0.0.1 _msdcs.chester-dc.example.com
> _ldap._tcp.dc SRV 'HAWAII.chester-dc.example.com 389 0 100'
>

Well, thanks. This worked for hawaii and alaska, but the two extra
invalid v-ward values (v-ward.chester-dc.com, v-ward.chester-dc) can't
be deleted, and one correct v-ward record
(v-ward.chester-dc.example.com) simply doesn't display with samba-tool
dns query. So:

# samba-tool dns delete 127.0.0.1 _msdcs.chester-dc.example.com
_ldap._tcp.dc srv 'HAWAII.chester-dc.example.com 389 0 100'
Cannot do GSSAPI to an IP address
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
Record deleted successfully
# samba-tool dns delete 127.0.0.1 _msdcs.chester-dc.example.com
_ldap._tcp.dc srv 'ALASKA.chester-dc.example.com 389 0 100'
Cannot do GSSAPI to an IP address
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
Record deleted successfully
# samba-tool dns delete 127.0.0.1 _msdcs.chester-dc.example.com
_ldap._tcp.dc srv 'v-ward.chester-dc.com 389 0 100'
Cannot do GSSAPI to an IP address
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
ERROR: Record does not exist
# samba-tool dns delete 127.0.0.1 _msdcs.chester-dc.example.com
_ldap._tcp.dc srv 'v-ward.chester-dc 389 0 100'
Cannot do GSSAPI to an IP address
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
ERROR: Record does not exist
#samba-tool dns query 127.0.0.1 _msdcs.chester-dc.example.com
_ldap._tcp.dc srv
Cannot do GSSAPI to an IP address
Password for [a...@CHESTER-DC.EXAMPLE.COM]:
Name=, Records=1, Children=0
SRV: v-fief.chester-dc.example.com. (389, 0, 100) (flags=f0,
serial=110, ttl=0)

#dig _ldap._tcp.dc._msdcs.chester-dc.example.com srv

; <<>> DiG 9.9.5-9+deb8u4-Debian <<>>
_ldap._tcp.dc._msdcs.chester-dc.example.com srv
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 193
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;_ldap._tcp.dc._msdcs.chester-dc.example.com. IN SRV

;; ANSWER SECTION:
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389
v-fief.chester-dc.example.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389
v-ward.chester-dc.example.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389
v-ward.chester-dc.com.
_ldap._tcp.dc._msdcs.chester-dc.example.com. 0 IN SRV 0 100 389
v-ward.chester-dc.

;; Query time: 1 msec
;; SERVER: 10.4.4.10#53(10.4.4.10)
;; WHEN: Tue Sep 13 16:29:01 BST 2016
;; MSG SIZE rcvd: 253
0 new messages