diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-12-07 19:47:48 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-12-07 19:47:48 +0000 |
commit | af41513e030691253b038ef1b3a7ff094435fcf9 (patch) | |
tree | 582a16c4c63f28505c6cba80548e6f67406da4b5 /packages | |
parent | c8c64be07161a9b95c9b3d7cb101f98894565310 (diff) | |
download | pfsense-packages-af41513e030691253b038ef1b3a7ff094435fcf9.tar.gz pfsense-packages-af41513e030691253b038ef1b3a7ff094435fcf9.tar.bz2 pfsense-packages-af41513e030691253b038ef1b3a7ff094435fcf9.zip |
Clarify name server records should be a hostname pointing to a A record
Diffstat (limited to 'packages')
-rw-r--r-- | packages/tinydns/tinydns.inc | 20 | ||||
-rw-r--r-- | packages/tinydns/tinydns_domains.xml | 12 |
2 files changed, 22 insertions, 10 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc index 7bfd44e0..591610be 100644 --- a/packages/tinydns/tinydns.inc +++ b/packages/tinydns/tinydns.inc @@ -121,27 +121,29 @@ 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) { - $record_type = ""; + foreach($config['installedpackages']['tinydnsdomains']['config'] as $domain) { + $record_data = ""; + $hostname = $domain['hostname']; + $ipaddress = $domain['ipaddress']; switch ($domain['recordtype']) { case "SOA": - $record_type = "."; + $record_data = ".{$hostname}::{$ipaddress}"; break; case "MX": - $record_type = "@"; + $record_data = "@{$hostname}:{$ipaddress}"; break; case "A": - $record_type = "+"; + $record_data = "+{$hostname}:{$ipaddress}"; break; case "PTR": - $record_type = "="; + $record_data = "={$hostname}:{$ipaddress}"; break; case "CNAME": - $record_type = "C"; + $record_data = "C{$hostname}:{$ipaddress}"; break; } - if($record_type) - fwrite($fd, $record_type . ":" . $domain['hostname'] . "\n"); + if($record_data) + fwrite($fd, $record_data . "\n"); } fclose($fd); /* tell tinydns to reload zone file */ diff --git a/packages/tinydns/tinydns_domains.xml b/packages/tinydns/tinydns_domains.xml index a16c2369..548bad4c 100644 --- a/packages/tinydns/tinydns_domains.xml +++ b/packages/tinydns/tinydns_domains.xml @@ -43,7 +43,14 @@ </options> </field> <field> - <fieldname>Failover Threshhold</fieldname> + <fieldname>ipaddress</fieldname> + <fielddescr>IP Address or hostname that record points to</fielddescr> + <description>Enter the IP Address that this record will point to (primary). The only exception is for NS type records where we expect a complete hostname to point to a A record.</description> + <required/> + <type>input</type> + </field> + <field> + <fieldname>Threshhold</fieldname> <fielddescr>Time in minutes before DNS switches to backup host</fielddescr> <type>input</type> </field> @@ -59,4 +66,7 @@ </rowhelper> </field> </fields> + <custom_php_resync_config_command> + tinydns_create_zone_file(); + </custom_php_resync_config_command> </packagegui> |