Bug 14044 - samba-tool does not display IPV6 PTR records properly
Summary: samba-tool does not display IPV6 PTR records properly
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: DNS server (internal) (show other bugs)
Version: 4.10.4
Hardware: x64 Linux
: P5 minor (vote)
Target Milestone: ---
Assignee: Kai Blin
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-22 23:57 UTC by Russell Thamm
Modified: 2020-09-28 04:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Russell Thamm 2019-07-22 23:57:49 UTC
samba-tool and RSAT DNS do not display IPv6 PTR records properly. I have seen this using samba 4.8.0 and 4.10.4 running on CentOS 7 with internal DNS.

[root@bilbo user]# samba-tool dns add localhost 4.e.7.c.9.3.0.b.4.7.6.0.7.8.d.f.ip6.arpa 5.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0 PTR brutus.dev.local
Password for [administrator@DEV.LOCAL]:
Record added successfully

[root@bilbo user]# nslookup fd87:0674:b039:c7e4::55
Server:		131.185.87.4
Address:	131.185.87.4#53

5.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.4.e.7.c.9.3.0.b.4.7.6.0.7.8.d.f.ip6.arpa	name = brutus.dev.local.

[root@bilbo user]# samba-tool dns query localhost 4.e.7.c.9.3.0.b.4.7.6.0.7.8.d.f.ip6.arpa @ PTR
Password for [administrator@DEV.LOCAL]:
  Name=, Records=0, Children=0
  Name=0, Records=0, Children=1

For the above record, RSAT DNS shows a folder labeled 0.

To view the PTR records, I have to use ldbsearch.

ldbsearch -H /usr/local/samba/private/sam.ldb -b "DC=DomainDnsZones,DC=dev,DC=local" "(objectclass=dnsNode)" --show-binary

# record 50
dn: DC=5.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0,DC=4.e.7.c.9.3.0.b.4.7.6.0.7.8.d.f.ip6.arpa,CN=MicrosoftDNS,DC=DomainDnsZones,DC=dev,DC=local
objectClass: top
objectClass: dnsNode
instanceType: 4
whenCreated: 20190718060248.0Z
whenChanged: 20190718060248.0Z
uSNCreated: 117101
uSNChanged: 117101
showInAdvancedViewOnly: TRUE
name: 5.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0
objectGUID: 674f6822-4a99-4f24-bfd5-4b2fe1308826
dnsRecord:     NDR: struct dnsp_DnssrvRpcRecord
        wDataLength              : 0x0014 (20)
        wType                    : DNS_TYPE_PTR (12)
        version                  : 0x05 (5)
        rank                     : DNS_RANK_ZONE (240)
        flags                    : 0x0000 (0)
        dwSerial                 : 0x0000000b (11)
        dwTtlSeconds             : 0x00000384 (900)
        dwReserved               : 0x00000000 (0)
        dwTimeStamp              : 0x0037fb7e (3668862)
        data                     : union dnsRecordData(case 12)
        ptr                      : brutus.dev.local

objectCategory: CN=Dns-Node,CN=Schema,CN=Configuration,DC=dev,DC=local
dc: 5.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0
distinguishedName: DC=5.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0,DC=4.e.7.c.9.3.0.b.4.7.6.0.7.8.d.f.ip6.arpa,CN=MicrosoftDNS,DC=DomainDnsZones,DC=dev,DC=local
Comment 1 Amit Kumar 2019-09-16 08:04:43 UTC
# samba-tool dns zonecreate localhost test-dns-zone -U Administrator
# samba-tool dns zonelist localhost -U Administrator
..
  pszZoneName                 : test-dns-zone
  Flags                       : DNS_RPC_ZONE_DSINTEGRATED DNS_RPC_ZONE_UPDATE_SECURE 
  ZoneType                    : DNS_ZONE_TYPE_PRIMARY
  Version                     : 50
  dwDpFlags                   : DNS_DP_AUTOCREATED DNS_DP_DOMAIN_DEFAULT DNS_DP_ENLISTED 
  pszDpFqdn                   : DomainDnsZones.samdom.amitexample.com
..

To keep note for myself, will be working
Comment 2 Amit Kumar 2019-09-24 07:57:08 UTC
1. Added a IPv6 PTR record. zone=test-dns-zone, record-name=ptr-record1
samba-tool dns add -h
Usage: samba-tool dns add <server> <zone> <name> <A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <data>

# samba-tool dns add localhost test-dns-zone ptr-record1 PTR sambadom.amitexample.com -U Administrator
Record added successfully


2. Wanted to query same PTR record, But cannot find.
# samba-tool dns query localhost test-dns-zone -h
Usage: samba-tool dns query <server> <zone> <name> <A|AAAA|CNAME|MX|NS|SOA|SRV|TXT|ALL> [options]
Query a name.

# samba-tool dns query localhost test-dns-zone ptr-record1 ALL -U Administrator
  Name=, Records=1, Children=0
    PTR: sambadom.amitexample.com (flags=f0, serial=2, ttl=900)


Findings:
a. samba-tool dns query does not 'PTR' record search command.
b. Also, record entry is not shown by query ALL.
Comment 3 Mikhail 2020-09-28 04:34:07 UTC
Zones "in-addr.arpa" and "ip6.arpa" cannot contain anything other than PTR records.

When a reverse zone is created for network /16 for ipv4 or any net for ipv6, a symbol "dot" appears in the ptr record.

The Samba DNS RPC server is trying to create a hierarchical structure based on symbol "dot" when enumerate records.

The DNS service returns the correct data. But RPC server return wrong data and it is impossible to manage the structure of the DNS either through the Windows applet or through the samba-tool.

Sorry for my English