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

Rowland Penny rpenny at samba.org
Tue Sep 13 14:51:04 UTC 2016


On Tue, 13 Sep 2016 15:20:29 +0100
ash-samba--- via samba <samba at lists.samba.org> wrote:

> > 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
> 
> 
> 

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




More information about the samba mailing list