diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-12-07 19:31:04 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-12-07 19:31:04 +0000 |
commit | c8c64be07161a9b95c9b3d7cb101f98894565310 (patch) | |
tree | 594a4bb038f8b9b658edd94bb3ec146fe720344f | |
parent | d6de3a27553b815e49cbcc0bd4356b942b18882c (diff) | |
download | pfsense-packages-c8c64be07161a9b95c9b3d7cb101f98894565310.tar.gz pfsense-packages-c8c64be07161a9b95c9b3d7cb101f98894565310.tar.bz2 pfsense-packages-c8c64be07161a9b95c9b3d7cb101f98894565310.zip |
* Create tinydns records correctly
* Cleanup required fields
-rw-r--r-- | packages/tinydns/tinydns.inc | 24 | ||||
-rw-r--r-- | packages/tinydns/tinydns_domains.xml | 16 |
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> |