aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/tinydns/tinydns.inc24
-rw-r--r--packages/tinydns/tinydns_domains.xml16
2 files changed, 33 insertions, 7 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc
index 55f5fe69..7bfd44e0 100644
--- a/packages/tinydns/tinydns.inc
+++ b/packages/tinydns/tinydns.inc
@@ -121,8 +121,28 @@ function tinydns_create_zone_file() {
conf_mount_rw();
$fd = fopen("/service/tinydns/root/data", "w");
if($config['installedpackages']['tinydnsdomains'])
- foreach($config['installedpackages']['tinydnsdomains'] as $domain)
- fwrite($fd, $domain['recordtype'] . ":" . $domain['hostname'] . "\n");
+ foreach($config['installedpackages']['tinydnsdomains'] as $domain) {
+ $record_type = "";
+ switch ($domain['recordtype']) {
+ case "SOA":
+ $record_type = ".";
+ break;
+ case "MX":
+ $record_type = "@";
+ break;
+ case "A":
+ $record_type = "+";
+ break;
+ case "PTR":
+ $record_type = "=";
+ break;
+ case "CNAME":
+ $record_type = "C";
+ break;
+ }
+ if($record_type)
+ fwrite($fd, $record_type . ":" . $domain['hostname'] . "\n");
+ }
fclose($fd);
/* tell tinydns to reload zone file */
exec("cd /service/tinydns/root && /usr/local/bin/tinydns-data");
diff --git a/packages/tinydns/tinydns_domains.xml b/packages/tinydns/tinydns_domains.xml
index 9e739b5a..a16c2369 100644
--- a/packages/tinydns/tinydns_domains.xml
+++ b/packages/tinydns/tinydns_domains.xml
@@ -11,10 +11,16 @@
<text>TinyDNS</text>
<url>/tinydns_filter.php</url>
<active/>
- </tab>
+ </tab>
+ <adddeleteeditpagefields>
+ <columnitem>
+ <fielddescr>Hostname</fielddescr>
+ <fieldname>hostname</fieldname>
+ </columnitem>
+ </adddeleteeditpagefields>
<fields>
<field>
- <fieldname>Hostname/Domain</fieldname>
+ <fieldname>hostname</fieldname>
<fielddescr>Domain name. Example: www.exampledomain.com</fielddescr>
<description>Enter the domain name that you would like to serve dns records for.</description>
<required/>
@@ -24,21 +30,21 @@
<fielddescr>Record type</fielddescr>
<fieldname>recordtype</fieldname>
<description>DNS Record type. MX, A, etc</description>
+ <required/>
<type>select</type>
<size>1</size>
<options>
<option><value></value><name></name></option>
<option><value>MX</value><name>MX</name></option>
<option><value>A</value><name>A</name></option>
- <option><value>SOA</value><name>.</name></option>
- <option><value>PTR</value><name>=</name></option>
+ <option><value>SOA</value><name>SOA</name></option>
+ <option><value>PTR</value><name>PTR</name></option>
<option><value>CNAME</value><name>CNAME</name></option>
</options>
</field>
<field>
<fieldname>Failover Threshhold</fieldname>
<fielddescr>Time in minutes before DNS switches to backup host</fielddescr>
- <required/>
<type>input</type>
</field>
<field>