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

[Samba] [samba_upgradedns] Error parsing DNS data

279 views
Skip to first unread message

Bouke J. Henstra

unread,
May 22, 2016, 9:00:03 AM5/22/16
to
Hello,

I am trying to change over from bind9 to internal dns.

For some reason I keep getting the following error:
Error parsing DNS data from '/opt/samba/private/dns/TH01.INET.zone' ()

I have inspected TH01.INET.ZONE but I could not find an error.

I do not understand this error message. I am hoping someone could help
me with this issue please. Your help will be very much appreciated.

Many thanks.

Notes:
I am currently running version 4.1.17 (I will upgrade to the latest
version after resolving this issue).
I am running the samba_upgradedns command as root after stopping samba
and bind9.

============================
= = = samba_upgradedns = = =
============================

root@comsrv01a:/opt/samba/sbin# ./samba_upgradedns
--dns-backend=SAMBA_INTERNAL --verbose -d 10
INFO: Current debug levels:
all: 10
tdb: 10
printdrivers: 10
lanman: 10
smb: 10
rpc_parse: 10
rpc_srv: 10
rpc_cli: 10
passdb: 10
sam: 10
auth: 10
winbind: 10
vfs: 10
idmap: 10
quota: 10
acls: 10
locking: 10
msdfs: 10
dmapi: 10
registry: 10
scavenger: 10
dns: 10
ldb: 10
lpcfg_load: refreshing parameters from /opt/samba/etc/smb.conf
params.c:pm_process() - Processing configuration file "/opt/samba/etc/smb.conf"
Processing section "[global]"
Processing section "[netlogon]"
Processing section "[sysvol]"
Processing section "[wpkg]"
Processing section "[packages]"
Processing section "[wsus]"
Processing section "[log]"
Processing section "[oldprofiles]"
pm_process() returned Yes
lpcfg_load: refreshing parameters from /opt/samba/etc/smb.conf
params.c:pm_process() - Processing configuration file "/opt/samba/etc/smb.conf"
Processing section "[global]"
Processing section "[netlogon]"
Processing section "[sysvol]"
Processing section "[wpkg]"
Processing section "[packages]"
Processing section "[wsus]"
Processing section "[log]"
Processing section "[oldprofiles]"
pm_process() returned Yes
Reading domain information
lpcfg_load: refreshing parameters from /opt/samba/etc/smb.conf
params.c:pm_process() - Processing configuration file "/opt/samba/etc/smb.conf"
Processing section "[global]"
Processing section "[netlogon]"
Processing section "[sysvol]"
Processing section "[wpkg]"
Processing section "[packages]"
Processing section "[wsus]"
Processing section "[log]"
Processing section "[oldprofiles]"
pm_process() returned Yes
Security token SIDs (1):
SID[ 0]: S-1-5-18
Privileges (0xFFFFFFFFFFFFFFFF):
Privilege[ 0]: SeMachineAccountPrivilege
Privilege[ 1]: SeTakeOwnershipPrivilege
Privilege[ 2]: SeBackupPrivilege
Privilege[ 3]: SeRestorePrivilege
Privilege[ 4]: SeRemoteShutdownPrivilege
Privilege[ 5]: SePrintOperatorPrivilege
Privilege[ 6]: SeAddUsersPrivilege
Privilege[ 7]: SeDiskOperatorPrivilege
Privilege[ 8]: SeSecurityPrivilege
Privilege[ 9]: SeSystemtimePrivilege
Privilege[ 10]: SeShutdownPrivilege
Privilege[ 11]: SeDebugPrivilege
Privilege[ 12]: SeSystemEnvironmentPrivilege
Privilege[ 13]: SeSystemProfilePrivilege
Privilege[ 14]: SeProfileSingleProcessPrivilege
Privilege[ 15]: SeIncreaseBasePriorityPrivilege
Privilege[ 16]: SeLoadDriverPrivilege
Privilege[ 17]: SeCreatePagefilePrivilege
Privilege[ 18]: SeIncreaseQuotaPrivilege
Privilege[ 19]: SeChangeNotifyPrivilege
Privilege[ 20]: SeUndockPrivilege
Privilege[ 21]: SeManageVolumePrivilege
Privilege[ 22]: SeImpersonatePrivilege
Privilege[ 23]: SeCreateGlobalPrivilege
Privilege[ 24]: SeEnableDelegationPrivilege
Rights (0x 0):
lpcfg_servicenumber: couldn't find ldb
schema_fsmo_init: we are master[yes] updates allowed[no]
lpcfg_servicenumber: couldn't find ldb
lpcfg_servicenumber: couldn't find ldb
lpcfg_servicenumber: couldn't find ldb
schema_fsmo_init: we are master[yes] updates allowed[no]
DNS accounts already exist
Reading records from zone file /opt/samba/private/dns/TH01.INET.zone
Error parsing DNS data from '/opt/samba/private/dns/TH01.INET.zone' ()
DNS records will be automatically created
Traceback (most recent call last):
File "./samba_upgradedns", line 316, in <module>
ncname = msg[0]['nCName'][0]
KeyError: 'No such element'
root@comsrv01a:/opt/samba/sbin#

=================================================
= = = /opt/samba/private/dns/TH01.INET.ZONE = = =
=================================================

root@comsrv01a:/opt/samba/sbin# cat /opt/samba/private/dns/TH01.INET.zone
$ORIGIN .
$TTL 604800 ; 1 week
th01.inet IN SOA comsrv01a.th01.inet. hostmaster.th01.inet. (
2013062828 ; serial
172800 ; refresh (2 days)
14400 ; retry (4 hours)
3628800 ; expire (6 weeks)
604800 ; minimum (1 week)
)
NS comsrv01a.th01.inet.
$TTL 900 ; 15 minutes
A 172.16.32.222
A 192.168.0.200
A 192.168.0.201
$ORIGIN th01.inet.
$TTL 604800 ; 1 week
_kerberos TXT "TH01.INET"
$ORIGIN _msdcs.th01.inet.
29f1582a-3589-4ebb-9755-7be96de04949 CNAME comsrv01tst.th01.inet.
$TTL 900 ; 15 minutes
b81d6916-6a8f-4c02-84e9-8dcc3a6bc8ba CNAME srv01ham.th01.inet.
$ORIGIN _tcp.Default-First-Site-Name._sites.dc._msdcs.th01.inet.
_kerberos SRV 0 100 88 srv01ham.th01.inet.
SRV 0 100 88 comsrv01a.th01.inet.
SRV 0 100 88 comsrv01tst.th01.inet.
_ldap SRV 0 100 389 srv01ham.th01.inet.
SRV 0 100 389 comsrv01a.th01.inet.
SRV 0 100 389 comsrv01tst.th01.inet.
$ORIGIN _tcp.dc._msdcs.th01.inet.
_kerberos SRV 0 100 88 srv01ham.th01.inet.
SRV 0 100 88 comsrv01a.th01.inet.
SRV 0 100 88 comsrv01tst.th01.inet.
_ldap SRV 0 100 389 srv01ham.th01.inet.
SRV 0 100 389 comsrv01a.th01.inet.
SRV 0 100 389 comsrv01tst.th01.inet.
$ORIGIN _msdcs.th01.inet.
_ldap._tcp.029d45d8-2621-4c7c-a944-23884cfd0dad.domains SRV 0 100 389
srv01ham.th01.inet.
SRV 0 100 389 comsrv01a.th01.inet.
SRV 0 100 389 comsrv01tst.th01.inet.
$TTL 604800 ; 1 week
f3ec5ecd-e121-4024-bc85-83b09e07401a CNAME comsrv01a.th01.inet.
$TTL 900 ; 15 minutes
gc A 172.16.32.222
A 192.168.0.200
A 192.168.0.201
$ORIGIN gc._msdcs.th01.inet.
_ldap._tcp.Default-First-Site-Name._sites SRV 0 100 3268 srv01ham.th01.inet.
SRV 0 100 3268 comsrv01a.th01.inet.
SRV 0 100 3268 comsrv01tst.th01.inet.
_ldap._tcp SRV 0 100 3268 srv01ham.th01.inet.
SRV 0 100 3268 comsrv01a.th01.inet.
SRV 0 100 3268 comsrv01tst.th01.inet.
$ORIGIN _msdcs.th01.inet.
$TTL 604800 ; 1 week
_ldap._tcp.pdc SRV 0 100 389 comsrv01a.th01.inet.
$ORIGIN _tcp.Default-First-Site-Name._sites.th01.inet.
$TTL 900 ; 15 minutes
_gc SRV 0 100 3268 srv01ham.th01.inet.
SRV 0 100 3268 comsrv01a.th01.inet.
SRV 0 100 3268 comsrv01tst.th01.inet.
_kerberos SRV 0 100 88 srv01ham.th01.inet.
SRV 0 100 88 comsrv01a.th01.inet.
SRV 0 100 88 comsrv01tst.th01.inet.
_ldap SRV 0 100 389 srv01ham.th01.inet.
SRV 0 100 389 comsrv01a.th01.inet.
SRV 0 100 389 comsrv01tst.th01.inet.
$ORIGIN _tcp.th01.inet.
_gc SRV 0 100 3268 srv01ham.th01.inet.
SRV 0 100 3268 comsrv01a.th01.inet.
SRV 0 100 3268 comsrv01tst.th01.inet.
_kerberos SRV 0 100 88 srv01ham.th01.inet.
SRV 0 100 88 comsrv01a.th01.inet.
SRV 0 100 88 comsrv01tst.th01.inet.
$TTL 604800 ; 1 week
_kerberos-master SRV 0 100 88 comsrv01a.th01.inet.
$TTL 900 ; 15 minutes
_kpasswd SRV 0 100 464 srv01ham.th01.inet.
SRV 0 100 464 comsrv01a.th01.inet.
SRV 0 100 464 comsrv01tst.th01.inet.
_ldap SRV 0 100 389 srv01ham.th01.inet.
SRV 0 100 389 comsrv01a.th01.inet.
SRV 0 100 389 comsrv01tst.th01.inet.
$ORIGIN _udp.th01.inet.
_kerberos SRV 0 100 88 srv01ham.th01.inet.
SRV 0 100 88 comsrv01a.th01.inet.
SRV 0 100 88 comsrv01tst.th01.inet.
$TTL 604800 ; 1 week
_kerberos-master SRV 0 100 88 comsrv01a.th01.inet.
$TTL 900 ; 15 minutes
_kpasswd SRV 0 100 464 srv01ham.th01.inet.
SRV 0 100 464 comsrv01a.th01.inet.
SRV 0 100 464 comsrv01tst.th01.inet.
$ORIGIN th01.inet.
$TTL 604800 ; 1 week
comsrv01a A 192.168.0.200
comsrv01tst A 192.168.0.201
$TTL 3600 ; 1 hour
nas001th A 192.168.0.17
$TTL 1200 ; 20 minutes
OZD01 A 192.168.0.232
S01D01 A 192.168.0.101
S01D02 A 192.168.0.102
S01D03 A 192.168.0.103
S01D04 A 192.168.0.114
S01D05 A 192.168.0.5
S01DA1 A 192.168.0.75
S01DX1 A 192.168.0.40
S01DX2 A 192.168.0.110
S01N01 A 172.16.32.41
S01N02 A 192.168.0.33
S01N99 A 192.168.0.117
S01NV1 A 192.168.0.66
$TTL 900 ; 15 minutes
srv01ham A 172.16.32.222
$TTL 1200 ; 20 minutes
T01D01 A 172.16.32.18
T01D02 A 172.16.32.70
THSRV01WIN A 192.168.0.18
$TTL 86400 ; 1 day
XRX9C934E2E4493 A 192.168.0.36

--

This message (and any associated files) may contain confidential and/or
privileged information. If you are not the intended recipient or authorized
to receive this for the intended recipient, you must not use, copy,
disclose or take any action based on this message or any information
herein. If you have received this message in error, please advise the
sender immediately by sending a reply e-mail and delete this message. Thank
you for your cooperation.

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

Rowland penny

unread,
May 22, 2016, 10:30:03 AM5/22/16
to
Are you using flat files with Samba and Bind ??

If so, what you are trying to do, will not work.

Rowland

Bouke J. Henstra

unread,
May 23, 2016, 3:20:03 PM5/23/16
to
Hello Rowland,

[Quote Bouke Henstra]
I am trying to change over from bind9 to internal dns.
For some reason I keep getting the following error:
Error parsing DNS data from '/opt/samba/private/dns/TH01.INET.zone' ()
[..]

[Quote Rowland Penny
Are you using flat files with Samba and Bind ??
If so, what you are trying to do, will not work.
Rowland
[..]

Thank you very much for your reply.

I am using flat files and bind.

I am not sure how to proceed. I could not (yet) find documentation
that applies to my situation.
I think I have read something before about moving away from flat files
but I can't find info online nor in my notes.

I have found the following information but it seems not to be
applicable to my situation:
https://wiki.samba.org/index.php/Changing_the_DNS_backend

And I have spent quite some time online but could not figure out if I
have to manually upgrade (and how) or that I can run a script.

Could you please point me into the right direction?

Many thanks.

Kind regards,

Bouke

--

This message (and any associated files) may contain confidential and/or
privileged information. If you are not the intended recipient or authorized
to receive this for the intended recipient, you must not use, copy,
disclose or take any action based on this message or any information
herein. If you have received this message in error, please advise the
sender immediately by sending a reply e-mail and delete this message. Thank
you for your cooperation.

Rowland penny

unread,
May 23, 2016, 4:10:03 PM5/23/16
to
The Samba DNS server expects to find the dns info in AD, so when you try
to upgrade from flatfiles to the internal DNS server, the upgrade cannot
find the required zone data.

All I can suggest, create a script to extract the data from the
flatfiles and then add it to AD with samba-tool. This may not work if
the domain dns zones etc don't exist in AD, so you may have to create
these as well.

Sorry if this sounds unhelpful, but I have never been in this situation
and cannot remember hearing of it before.

Rowland

Andrew Bartlett

unread,
May 27, 2016, 6:20:03 PM5/27/16
to
On Sun, 2016-05-22 at 14:24 +0200, Bouke J. Henstra wrote:
> Hello,
>
> I am trying to change over from bind9 to internal dns.
>
> For some reason I keep getting the following error:
> Error parsing DNS data from '/opt/samba/private/dns/TH01.INET.zone'
> ()
>
> I have inspected TH01.INET.ZONE but I could not find an error.
>
> I do not understand this error message. I am hoping someone could
> help
> me with this issue please. Your help will be very much appreciated.
>
> Many thanks.
>
> Notes:
> I am currently running version 4.1.17 (I will upgrade to the latest
> version after resolving this issue).
> I am running the samba_upgradedns command as root after stopping
> samba
> and bind9.

I take it you are trying to move from the flatfile based bind to internal.

The samba_upgradedns script is pretty simple, and uses the dnspython
library to read zone files. It certainly could be the case that it
just can't read the zone file after bind9 has been doing dynamic
updates on it.
Perhaps get a newer dnspython lib on your system, and see if that
helps.
In many ways you are lucky, as this script is a little too lax with the
exception handling, and any error at all means it will just re-create
the DNS data from scratch, without importing the data (please file a
bug).  
The second exception (on ncName) is fixed in 4.4.
Sorry,

Andrew Bartlett

--
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba

Bouke J. Henstra

unread,
May 28, 2016, 5:00:03 PM5/28/16
to
​Hello Andrew,

Thank you for your reply (very much appreciated).

> I take it you are trying to move from the flatfile based bind to internal.

That is correct

> The samba_upgradedns script is pretty simple, and uses the
> dnspython library to read zone files. It certainly could be
> the case that it just can't read the zone file after bind9
> has been doing dynamic updates on it.

> Perhaps get a newer dnspython lib on your system,
> and see if that helps.

I have installed the most recent version I could find at:
https://github.com/rthalley/dnspython

The script samba_upgradedns returns the following error:
Error parsing DNS data from '/opt/samba/private/dns/TH01.INET.zone' (The
DNS zone has no SOA RR at its origin.)

This could mean that I should add a Start of Authority Resource Record at
the top of the TH01.INET.zone file to make it work/acceptable? I am
considering to create a backup of this file and try again with a SOA RR.

I am only a little bit worried about the second exception.

Please note: I just did upgrade to Samba 4.4.3 (as I do want to change over
to Samba's internal DNS).

The returned error is:
Traceback (most recent call last):
File "./samba_upgradedns", line 317, in <module>
ncname = msg[0]['nCName'][0]
KeyError: 'No such element'

> In many ways you are lucky, as this script is a little too lax
> with the exception handling, and any error at all means it will
> just re-create the DNS data from scratch, without importing the data
> (please file a bug).

I will file a bug as soon as possible.

> The second exception (on ncName) is fixed in 4.4.
> Sorry,
> Andrew Bartlett

Does this mean that the script would end without issues when I add a SOA RR
to the zone file combined with a fix regarding to the second exception? Note:
I just did upgrade to Samba 4.4.3.

Please find my console output below.

root@comsrv01a:/opt/samba/sbin# service samba4 stop && service bind9 stop
samba4 stop/waiting
* Stopping domain name service... bind9
waiting for pid 3322 to die
[ OK ]

root@comsrv01a:/opt/samba/sbin# ./samba_upgradedns
--dns-backend=SAMBA_INTERNAL
lpcfg_load: refreshing parameters from /opt/samba/etc/smb.conf
Reading domain information
lpcfg_load: refreshing parameters from /opt/samba/etc/smb.conf
DNS accounts already exist
Reading records from zone file /opt/samba/private/dns/TH01.INET.zone
Error parsing DNS data from '/opt/samba/private/dns/TH01.INET.zone' (The
DNS zone has no SOA RR at its origin.)
DNS records will be automatically created
Traceback (most recent call last):
File "./samba_upgradedns", line 317, in <module>
ncname = msg[0]['nCName'][0]
KeyError: 'No such element'

root@comsrv01a:/opt/samba/sbin# service bind9 start && service samba4 start
* Starting domain name service... bind9
[ OK ]
samba4 start/running, process 7693

root@comsrv01a:/opt/samba/sbin# ./samba --version
Version 4.4.3

Many thanks for your help/reply.

Kind regards,

Bouke

--

This message (and any associated files) may contain confidential and/or
privileged information. If you are not the intended recipient or authorized
to receive this for the intended recipient, you must not use, copy,
disclose or take any action based on this message or any information
herein. If you have received this message in error, please advise the
sender immediately by sending a reply e-mail and delete this message. Thank
you for your cooperation.
0 new messages