diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql
index ed23e829999ee72e4bd5ff9a2c2d0440ca7f125d..2c4300a67826a7bb1bb9b6b66cac71c38afdc5e0 100644
--- a/install/sql/incremental/upd_dev_collection.sql
+++ b/install/sql/incremental/upd_dev_collection.sql
@@ -25,7 +25,7 @@ ALTER TABLE `client_template`
 
 ALTER TABLE  `client` ADD  `contact_firstname` VARCHAR( 64 ) NOT NULL DEFAULT '' AFTER  `gender`;
 
-UPDATE `dns_template` SET `fields` = 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM' WHERE `dns_template`.`template_id` =1;
+UPDATE `dns_template` SET `fields` = 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC' WHERE `dns_template`.`template_id` =1;
 UPDATE `dns_template` SET `template` = '[ZONE]
 origin={DOMAIN}.
 ns={NS1}.
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 0c9b893ef19e958ef79e6605bad8adae63d3a986..9d7509506d1b8391e6914f9501945f96da95a457 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -2397,7 +2397,7 @@ INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`, `eu`)
 -- Dumping data for table `dns_template`
 -- 
 
-INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
+INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM,DNSSEC', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
 
 
 -- --------------------------------------------------------
diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index 219fdfabda78cd343500326b9db882e57a78a348..c3cc7f170dbc56afbf769b82522959e1485820d6 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -206,7 +206,7 @@ class page_action extends tform_actions {
 				if($reseller['customer_no_template'] != '') {
 					//* Set customer no default
 					$customer_no = $app->functions->intval($reseller['customer_no_start']+$reseller['customer_no_counter']);
-					$customer_no_string = str_replace('[CUSTOMER_NO]',$customer_no,$reseller['customer_no_template']);
+					$customer_no_string = str_replace(array('[CUSTOMER_NO]','[CLIENTID]'),array($customer_no, $reseller['client_id']),$reseller['customer_no_template']);
 					$app->tpl->setVar('customer_no',$customer_no_string);
 				}
 			}
diff --git a/interface/web/dns/dns_wizard.php b/interface/web/dns/dns_wizard.php
index bacadf19c812b73c1cc08550ccb4e628e53e564e..b6534a3970abb267f8e3f366ee1ffbb3f6ccdcfd 100644
--- a/interface/web/dns/dns_wizard.php
+++ b/interface/web/dns/dns_wizard.php
@@ -300,6 +300,7 @@ if($_POST['create'] == 1) {
 	if($_POST['ns1'] != '') $tpl_content = str_replace('{NS1}', $_POST['ns1'], $tpl_content);
 	if($_POST['ns2'] != '') $tpl_content = str_replace('{NS2}', $_POST['ns2'], $tpl_content);
 	if($_POST['email'] != '') $tpl_content = str_replace('{EMAIL}', $_POST['email'], $tpl_content);
+	$enable_dnssec = (($_POST['dnssec'] == 'Y') ? 'Y' : 'N');
 	if(isset($_POST['dkim']) && preg_match('/^[\w\.\-\/]{2,255}\.[a-zA-Z0-9\-]{2,30}[\.]{0,1}$/', $_POST['domain'])) {
 		$sql = $app->db->queryOneRecord("SELECT dkim_public, dkim_selector FROM mail_domain WHERE domain = ? AND dkim = 'y' AND ".$app->tform->getAuthSQL('r'), $_POST['domain']);
 		$public_key = $sql['dkim_public'];
@@ -395,7 +396,8 @@ if($_POST['create'] == 1) {
 			"active" => 'Y',
 			"xfer" => $xfer,
 			"also_notify" => $also_notify,
-			"update_acl" => $update_acl
+			"update_acl" => $update_acl,
+			"dnssec_wanted" => $enable_dnssec
 		);
 		$dns_soa_id = $app->db->datalogInsert('dns_soa', $insert_data, 'id');
 
diff --git a/interface/web/dns/form/dns_template.tform.php b/interface/web/dns/form/dns_template.tform.php
index 8c2b17580a315f9dd1fd45786f66071b56bca0cd..541eec4445b4ceae7ea698b831bb2668820d1317 100644
--- a/interface/web/dns/form/dns_template.tform.php
+++ b/interface/web/dns/form/dns_template.tform.php
@@ -74,7 +74,7 @@ $form["tabs"]['template'] = array (
 			'formtype' => 'CHECKBOXARRAY',
 			'default' => '',
 			'separator' => ',',
-			'value'  => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM'),
+			'value'  => array('DOMAIN' => 'Domain', 'IP' => 'IP Address', 'IPV6' => 'IPv6 Address', 'NS1' => 'NS 1', 'NS2' => 'NS 2', 'EMAIL' => 'Email', 'DKIM' => 'DKIM', 'DNSSEC' => 'DNSSEC'),
 			'validators'    => array (  0 => array ('type'  => 'CUSTOM',
 					'class' => 'validate_dkim',
 					'function' => 'check_template',
diff --git a/interface/web/dns/templates/dns_wizard.htm b/interface/web/dns/templates/dns_wizard.htm
index 255a1f81c829e4c37fd7b18340a7f3e42cd91e67..907dedca888b4e5f987854fac46eca215025125f 100644
--- a/interface/web/dns/templates/dns_wizard.htm
+++ b/interface/web/dns/templates/dns_wizard.htm
@@ -89,10 +89,16 @@
                     <div class="col-sm-9"><input type="text" name="email" id="email" value="{tmpl_var name='email'}" class="form-control" /></div></div>
             </tmpl_if>
             <tmpl_if name="DKIM_VISIBLE">
-		    <label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
-                    &nbsp;&nbsp;<input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/>
+				<div class="form-group">
+					<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
+                    <div class="col-sm-9"><input type="checkbox" disabled readonly checked><input name="dkim" type="hidden" maxlength="255" type="text"/></div></div>
             </tmpl_if>
-
+            <tmpl_if name="DNSSEC_VISIBLE">
+				<div class="form-group">
+					<label for="dkim" class="col-sm-3 control-label">{tmpl_var name='dnssec_txt'}</label>
+                    <div class="col-sm-9"><input type="checkbox" name="dnssec" value="Y"></div></div>
+            </tmpl_if>
+			
         
             
         <input type="hidden" name="create" value="0" />
diff --git a/interface/web/login/index.php b/interface/web/login/index.php
index 5339f042940de5cb11e2fefb534512d6c7c1c6f2..63ac07422c14becff8d4988e8d104405b0970b00 100644
--- a/interface/web/login/index.php
+++ b/interface/web/login/index.php
@@ -60,7 +60,7 @@ if(count($_POST) > 0) {
 
 	//** Check variables
 	if(!preg_match("/^[\w\.\-\_\@]{1,128}$/", $_POST['username'])) $error = $app->lng('user_regex_error');
-	if(!preg_match("/^.{1,64}$/i", $_POST['password'])) $error = $app->lng('pw_error_length');
+	if(!preg_match("/^.{1,256}$/i", $_POST['password'])) $error = $app->lng('pw_error_length');
 
 	//** importing variables
 	$ip    = ip2long($_SERVER['REMOTE_ADDR']);
diff --git a/interface/web/login/lib/lang/ar.lng b/interface/web/login/lib/lang/ar.lng
index 9ba00721306b1ee46f4ddefa303a46db401f3976..0c5f6cd706b64f654d12910e6194d05f4862ae33 100644
--- a/interface/web/login/lib/lang/ar.lng
+++ b/interface/web/login/lib/lang/ar.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Please enter email address and username.';
 $wb['pw_reset_mail_msg'] = 'The password to your ISPConfig 3 control panel account has been reset. The new password is: ';
 $wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel password has been reset.';
 $wb['user_regex_error'] = 'Username contains unallowed characters or is longer then 64 characters.';
-$wb['pw_error_length'] = 'The password length is < 1 or > 64 characters.';
+$wb['pw_error_length'] = 'The password length is < 1 or > 256 characters.';
 $wb['username_txt'] = 'Username';
 $wb['password_txt'] = 'Password';
 $wb['login_button_txt'] = 'Login';
diff --git a/interface/web/login/lib/lang/bg.lng b/interface/web/login/lib/lang/bg.lng
index 09906f7109e2c583feefdef1e62850aa286b32c1..23a818e0a31d3a13ac06e147640fadcb2464f542 100644
--- a/interface/web/login/lib/lang/bg.lng
+++ b/interface/web/login/lib/lang/bg.lng
@@ -6,7 +6,7 @@ $wb['pw_error_noinput'] = 'Моля въведете потребителско
 $wb['pw_reset_mail_msg'] = 'Новата парола за вашия ISPConfig 3 контролен панел е:';
 $wb['pw_reset_mail_title'] = 'Нова парола за вашия ISPConfig 3 контролен панел';
 $wb['user_regex_error'] = 'Потребителско име contains unallowed characters or is longer then 64 characters.';
-$wb['pw_error_length'] = 'The password length is < 1 or > 64 characters.';
+$wb['pw_error_length'] = 'The password length is < 1 or > 256 characters.';
 $wb['error_user_password_empty'] = 'Потребителско име or Password empty.';
 $wb['error_user_password_incorrect'] = 'Потребителско име or Password wrong.';
 $wb['error_user_blocked'] = 'User is blocked.';
diff --git a/interface/web/login/lib/lang/de.lng b/interface/web/login/lib/lang/de.lng
index 445291c3db9bc7e3a09f9f5b2977c67d21407b7c..217e5c51b05c608c008c59d3efb46b9e5fa17e7c 100644
--- a/interface/web/login/lib/lang/de.lng
+++ b/interface/web/login/lib/lang/de.lng
@@ -13,7 +13,7 @@ $wb['pw_reset_mail_title'] = 'Ihr Passwort wurde zurückgesetzt';
 $wb['pw_reset_act_mail_msg'] = 'Bitte bestätigen Sie die Anforderung eines neuen Passworts, indem Sie folgenden Link besuchen: ';
 $wb['pw_reset_act_mail_title'] = 'Anforderung zum Zurücksetzen des Passworts';
 $wb['user_regex_error'] = 'Benutzername beinhaltet nicht erlaubte Zeichen oder ist länger als 64 Zeichen.';
-$wb['pw_error_length'] = 'Die Passwortlänge ist < 1 oder > 64 Zeichen.';
+$wb['pw_error_length'] = 'Die Passwortlänge ist < 1 oder > 256 Zeichen.';
 $wb['login_txt'] = 'Anmelden';
 $wb['username_txt'] = 'Benutzername';
 $wb['password_txt'] = 'Passwort';
diff --git a/interface/web/login/lib/lang/en.lng b/interface/web/login/lib/lang/en.lng
index 2f9fcdb32c8e752bdb90e9820c43111214f323fe..2db2d49f94566b51b3aa99e953c3bf368bd8f7c7 100644
--- a/interface/web/login/lib/lang/en.lng
+++ b/interface/web/login/lib/lang/en.lng
@@ -13,7 +13,7 @@ $wb['pw_reset_mail_title']  = 'ISPConfig 3 Control panel password has been reset
 $wb['pw_reset_act_mail_title']  = 'Confirm ISPConfig 3 Control panel password reset';
 $wb['pw_reset_act_mail_msg']    = 'Please confirm that your want to reset your ISPConfig 3 control panel account password by visiting the following activation link: ';
 $wb['user_regex_error'] = 'Username contains unallowed characters or is longer than 64 characters.';
-$wb['pw_error_length']  = 'The password length is < 1 or > 64 characters.';
+$wb['pw_error_length']  = 'The password length is < 1 or > 256 characters.';
 $wb['email_error'] = 'Email contains unallowed characters or has a invalid format.';
 $wb['login_txt']	= "Login";
 $wb['username_txt']	= "Username";
diff --git a/interface/web/login/lib/lang/hr.lng b/interface/web/login/lib/lang/hr.lng
index c8bad67a5b847d20ab33e3bd424c608ea2ea6cfa..f76f81e74fb2e181d83bd7eea7f6a4f636bfa99d 100644
--- a/interface/web/login/lib/lang/hr.lng
+++ b/interface/web/login/lib/lang/hr.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Unesite email adresu i korisničko ime.';
 $wb['pw_reset_mail_msg'] = 'Šifra za ISPConfig 3 control panel račun je resetirana. Vaša nova šifra je: ';
 $wb['pw_reset_mail_title'] = 'Resetirana ISPConfig 3 control panel Å¡ifra.';
 $wb['user_regex_error'] = 'Korisničko ime sadrži nedozvoljene znakove ili je dulje od 64 znaka.';
-$wb['pw_error_length'] = 'Duljina Å¡ifre je > 64 znakova.';
+$wb['pw_error_length'] = 'Duljina Å¡ifre je > 256 znakova.';
 $wb['username_txt'] = 'Korisničko ime';
 $wb['password_txt'] = 'Å ifra';
 $wb['login_button_txt'] = 'Prijava';
diff --git a/interface/web/login/lib/lang/id.lng b/interface/web/login/lib/lang/id.lng
index a71c688d1f2d2a8050f6395659f0c6c06ff65a90..f8fdef049e638d8f7cd12ba7639cd81f436cdff2 100644
--- a/interface/web/login/lib/lang/id.lng
+++ b/interface/web/login/lib/lang/id.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Masukkan alamat email dan nama pengguna.';
 $wb['pw_reset_mail_msg'] = 'Kata sandi untuk control panel ISPConfig 3 Anda telah direset. Kata sandi yang baru adalah: ';
 $wb['pw_reset_mail_title'] = 'Kata sandi Control Panel ISPConfig 3 telah direset.';
 $wb['user_regex_error'] = 'Nama Pengguna mengandung karakter yang tidak diperbolehkan atau lebih dari 64 karakter.';
-$wb['pw_error_length'] = 'Panjang kata sandi > 64 karakter.';
+$wb['pw_error_length'] = 'Panjang kata sandi > 256 karakter.';
 $wb['username_txt'] = 'Nama Pengguna';
 $wb['password_txt'] = 'Kata Sandi';
 $wb['login_button_txt'] = 'Masuk';
diff --git a/interface/web/login/lib/lang/nl.lng b/interface/web/login/lib/lang/nl.lng
index 142be8540a4eebf609029f6b842808714952b6d2..c5d8844b7aecca9fbd8a72e53f9914f9eb55894d 100644
--- a/interface/web/login/lib/lang/nl.lng
+++ b/interface/web/login/lib/lang/nl.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Voer a.u.b. een e-mailadres en gebruikersnaam in.';
 $wb['pw_reset_mail_msg'] = 'Het wachtwoord  dat toegang biedt tot uw ISPConfig 3 control panel account is gereset. Het nieuwe wachtwoord is: ';
 $wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel wachtwoord is gereset.';
 $wb['user_regex_error'] = 'Gebruikersnaam bevat karakters die niet zijn toegestaan of is langer dan 64 karakters.';
-$wb['pw_error_length'] = 'De lengte van het wachtwoord is > 64 karakters.';
+$wb['pw_error_length'] = 'De lengte van het wachtwoord is > 256 karakters.';
 $wb['username_txt'] = 'Gebruikersnaam';
 $wb['password_txt'] = 'Wachtwoord';
 $wb['login_button_txt'] = 'Login';
diff --git a/interface/web/login/lib/lang/pl.lng b/interface/web/login/lib/lang/pl.lng
index 169832f4949aff6fe3d0aea0bbc5498023fbf21f..61d3a1988e8c6ec827a5aeaaad79604570b2dc74 100644
--- a/interface/web/login/lib/lang/pl.lng
+++ b/interface/web/login/lib/lang/pl.lng
@@ -6,7 +6,7 @@ $wb['pw_error_noinput'] = 'Podaj nazwę użytkownika i adres e-mail.';
 $wb['pw_reset_mail_msg'] = 'Hasło do Twojego panelu w ISPConfig 3 zostało zresetowane. Twoje nowe hasło to: ';
 $wb['pw_reset_mail_title'] = 'Hasło do panelu w ISPConfig 3 zostało zresetowane.';
 $wb['user_regex_error'] = 'Nazwa użytkownika zawiera niedozwolone znaki lub jest dłuższa niż 64 znaki.';
-$wb['pw_error_length'] = 'Długość hasła jest > 64 znaki.';
+$wb['pw_error_length'] = 'Długość hasła jest > 256 znaki.';
 $wb['error_user_password_empty'] = 'Pusta nazwa użytkownika lub hasło.';
 $wb['error_user_password_incorrect'] = 'Niepoprawna nazwa użytownika lub hasło.';
 $wb['error_user_blocked'] = 'Konto użytkownika zostało zablokowane.';
diff --git a/interface/web/login/lib/lang/ro.lng b/interface/web/login/lib/lang/ro.lng
index 7b8ac4b917b4d976c8945cace07985941f184e19..fedc8f3977fe7199fe9c12618dc644e02e6e6f3b 100644
--- a/interface/web/login/lib/lang/ro.lng
+++ b/interface/web/login/lib/lang/ro.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'introduceti email address si username.';
 $wb['pw_reset_mail_msg'] = 'Parola la panoul de control a fost resetata . Noua parola este : ';
 $wb['pw_reset_mail_title'] = 'parola panoului de control a fost schimbata';
 $wb['user_regex_error'] = 'Username contine caractere nepermise sau are mai mult de 64 caractere';
-$wb['pw_error_length'] = 'Lungime parola  > 64 caractere.';
+$wb['pw_error_length'] = 'Lungime parola  > 256 caractere.';
 $wb['username_txt'] = 'Username';
 $wb['password_txt'] = 'Password';
 $wb['login_button_txt'] = 'Login';
diff --git a/interface/web/login/lib/lang/se.lng b/interface/web/login/lib/lang/se.lng
index eb454890a267bee024ad4059d2e989b55c1b0ee5..caeb3e709ee1960afc4d007ac381b19e62bdc660 100644
--- a/interface/web/login/lib/lang/se.lng
+++ b/interface/web/login/lib/lang/se.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Vänligen fyll i epostadress och användarnamn.';
 $wb['pw_reset_mail_msg'] = 'The password to your ISPConfig 3 control panel account has been reset. The new password is: ';
 $wb['pw_reset_mail_title'] = 'ISPConfig 3 Control panel password has been reset.';
 $wb['user_regex_error'] = 'Username contains unallowed characters or is longer then 64 characters.';
-$wb['pw_error_length'] = 'Lösenrodslängden är > 64 tecken.';
+$wb['pw_error_length'] = 'Lösenrodslängden är > 256 tecken.';
 $wb['username_txt'] = 'Användarnamn';
 $wb['password_txt'] = 'Lösenord';
 $wb['login_button_txt'] = 'Logga in';
diff --git a/interface/web/login/lib/lang/sk.lng b/interface/web/login/lib/lang/sk.lng
index d4b91e407e55dccf1b8409033c41e004e00e1154..ff4930c6c68253f53fd7bd2ecb30e82ffc1faec2 100644
--- a/interface/web/login/lib/lang/sk.lng
+++ b/interface/web/login/lib/lang/sk.lng
@@ -10,7 +10,7 @@ $wb['pw_error_noinput'] = 'Prosím, zadajte e-mailovú adresu a Užívateľské
 $wb['pw_reset_mail_msg'] = 'Heslo k svojmu účtu na ovládacom paneli bol resetnuté. Nové heslo je:';
 $wb['pw_reset_mail_title'] = 'Heslo ovládacieho panelu bolo resetnuté.';
 $wb['user_regex_error'] = 'Užívateľské meno obsahuje neplatné znaky, alebo je dlhšia ako 64 znakov.';
-$wb['pw_error_length'] = 'Dĺžka hesla je > 64 znakov.';
+$wb['pw_error_length'] = 'Dĺžka hesla je > 256 znakov.';
 $wb['username_txt'] = 'Užívateľské meno';
 $wb['password_txt'] = 'Heslo';
 $wb['login_button_txt'] = 'Prihlásenie';
diff --git a/server/lib/classes/cron.d/550-bind_dnssec.inc.php b/server/lib/classes/cron.d/550-bind_dnssec.inc.php
index 2d238c7f4cc58ba6c7351459c2eb8f567880e675..eb145fca34e0cdfaa3cd89a57fd72c1e806122a4 100644
--- a/server/lib/classes/cron.d/550-bind_dnssec.inc.php
+++ b/server/lib/classes/cron.d/550-bind_dnssec.inc.php
@@ -35,6 +35,27 @@ class cronjob_bind_dnssec extends cronjob {
 
 	// job schedule
 	protected $_schedule = '30 3 * * *'; //daily at 3:30 a.m.
+	
+	private function increase_serial($serial){
+		global $app, $conf;
+
+		// increase serial
+		$serial_date = $app->functions->intval(substr($serial, 0, 8));
+		$count = $app->functions->intval(substr($serial, 8, 2));
+		$current_date = date("Ymd");
+		if($serial_date >= $current_date){
+			$count += 1;
+			if ($count > 99) {
+				$serial_date += 1;
+				$count = 0;
+			}
+			$count = str_pad($count, 2, "0", STR_PAD_LEFT);
+			$new_serial = $serial_date.$count;
+		} else {
+			$new_serial = $current_date.'01';
+		}
+		return $new_serial;
+	}
 
 	public function onRunJob() {
 		global $app, $conf;
@@ -54,31 +75,8 @@ class cronjob_bind_dnssec extends cronjob {
 			$domain = substr($data['origin'], 0, strlen($data['origin'])-1);
 			if (!file_exists($dns_config['bind_zonefiles_dir'].'/'.$filespre.$domain)) return false;
 			
-			$app->log('DNSSEC Auto-Resign: Resigning zone '.$domain, LOGLEVEL_INFO);
-			
-			$zonefile = file_get_contents($dns_config['bind_zonefiles_dir'].'/'.$filespre.$domain);
-			$keycount=0;
-			foreach (glob($dns_config['bind_zonefiles_dir'].'/K'.$domain.'*.key') as $keyfile) {
-				$includeline = '$INCLUDE '.basename($keyfile);
-				if (!preg_match('@'.preg_quote($includeline).'@', $zonefile)) $zonefile .= "\n".$includeline."\n";
-				$keycount++;
-			}
-			if ($keycount != 2) $app->log('DNSSEC Warning: There are more or less than 2 keyfiles for zone '.$domain, LOGLEVEL_WARN);
-			file_put_contents($dns_config['bind_zonefiles_dir'].'/'.$filespre.$domain, $zonefile);
-			
-			//Sign the zone and set it valid for max. 16 days
-			exec('cd '.escapeshellcmd($dns_config['bind_zonefiles_dir']).';'.
-				 '/usr/sbin/dnssec-signzone -A -e +1382400 -3 $(head -c 1000 /dev/random | sha1sum | cut -b 1-16) -N increment -o '.escapeshellcmd($domain).' -t '.$filespre.escapeshellcmd($domain));
-				 
-			//Write Data back into DB
-			$dnssecdata = "DS-Records:\n".file_get_contents($dns_config['bind_zonefiles_dir'].'/dsset-'.$domain.'.');
-			$dnssecdata .= "\n------------------------------------\n\nDNSKEY-Records:\n";
-			foreach (glob($dns_config['bind_zonefiles_dir'].'/K'.$domain.'*.key') as $keyfile) {
-				$dnssecdata .= file_get_contents($keyfile)."\n\n";
-			}
-			
-			$app->db->query('UPDATE dns_soa SET dnssec_info=\''.$dnssecdata.'\', dnssec_initialized=\'Y\', dnssec_last_signed=\''.time().'\' WHERE id='.$data['id']);
-			$data = next($soas);
+			$app->log('DNSSEC Auto-Resign: Touching zone '.$domain, LOGLEVEL_INFO);
+			$app->db->datalogUpdate('dns_soa', array("serial" => $this->increase_serial($data['serial'])), 'id', $data['id']);
 		}
 		
 		parent::onRunJob();
@@ -86,4 +84,4 @@ class cronjob_bind_dnssec extends cronjob {
 
 }
 
-?>
+?>
\ No newline at end of file