aboutsummaryrefslogtreecommitdiffstats
path: root/packages/tinydns/tinydns.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-12-07 19:31:04 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-12-07 19:31:04 +0000
commitc8c64be07161a9b95c9b3d7cb101f98894565310 (patch)
tree594a4bb038f8b9b658edd94bb3ec146fe720344f /packages/tinydns/tinydns.inc
parentd6de3a27553b815e49cbcc0bd4356b942b18882c (diff)
downloadpfsense-packages-c8c64be07161a9b95c9b3d7cb101f98894565310.tar.gz
pfsense-packages-c8c64be07161a9b95c9b3d7cb101f98894565310.tar.bz2
pfsense-packages-c8c64be07161a9b95c9b3d7cb101f98894565310.zip
* Create tinydns records correctly
* Cleanup required fields
Diffstat (limited to 'packages/tinydns/tinydns.inc')
-rw-r--r--packages/tinydns/tinydns.inc24
1 files changed, 22 insertions, 2 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");