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/tinydns/tinydns.inc | |
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/tinydns/tinydns.inc')
-rw-r--r-- | packages/tinydns/tinydns.inc | 20 |
1 files changed, 11 insertions, 9 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 */ |