From f9b5d5e5c746895607d8b667dc88bd3ad452e687 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 6 Dec 2007 00:57:40 +0000 Subject: The attached patch adds a field to the services_dyndns.php form. This field if provided will be written to the nscommands file (in services.inc) as "server \n" This allows you to update an arbitrary DNS server. If not provided, the server line is omitted and the default behavior occurs. Submitted-by: Ben Timby --- etc/inc/services.inc | 5 ++++- usr/local/www/services_dyndns.php | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index cc42ee4..5327908 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -939,7 +939,10 @@ EOD; fclose($fd); /* generate update instructions */ - $upinst = "update delete {$config['dnsupdate']['host']} A\n"; + $upinst = ""; + if (!empty($config['dnsupdate']['server'])) + $upinst .= "server {$config['dnsupdate']['server']}\n"; + $upinst .= "update delete {$config['dnsupdate']['host']} A\n"; $upinst .= "update add {$config['dnsupdate']['host']} {$config['dnsupdate']['ttl']} A {$wanip}\n"; $upinst .= "\n"; /* mind that trailing newline! */ diff --git a/usr/local/www/services_dyndns.php b/usr/local/www/services_dyndns.php index ec0be45..856a378 100755 --- a/usr/local/www/services_dyndns.php +++ b/usr/local/www/services_dyndns.php @@ -53,6 +53,7 @@ $pconfig['dnsupdate_keyname'] = $config['dnsupdate']['keyname']; $pconfig['dnsupdate_keytype'] = $config['dnsupdate']['keytype']; if (!$pconfig['dnsupdate_keytype']) $pconfig['dnsupdate_keytype'] = "zone"; +$pconfig['dnsupdate_server'] = $config['dnsupdate']['server']; $pconfig['dnsupdate_usetcp'] = isset($config['dnsupdate']['usetcp']); if ($_POST) { @@ -110,6 +111,7 @@ if ($_POST) { $config['dnsupdate']['keyname'] = $_POST['dnsupdate_keyname']; $config['dnsupdate']['keytype'] = $_POST['dnsupdate_keytype']; $config['dnsupdate']['keydata'] = $_POST['dnsupdate_keydata']; + $config['dnsupdate']['server'] = $_POST['dnsupdate_server']; $config['dnsupdate']['usetcp'] = $_POST['dnsupdate_usetcp'] ? true : false; write_config(); @@ -152,6 +154,7 @@ function enable_change(enable_change) { document.iform.dnsupdate_keytype[1].disabled = endis; document.iform.dnsupdate_keytype[2].disabled = endis; document.iform.dnsupdate_keydata.disabled = endis; + document.iform.dnsupdate_server.disabled = endis; document.iform.dnsupdate_usetcp.disabled = endis; } //--> @@ -272,6 +275,12 @@ function enable_change(enable_change) {
Paste an HMAC-MD5 key here. + + + Server + + + Protocol -- cgit v1.1