From af41513e030691253b038ef1b3a7ff094435fcf9 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 7 Dec 2006 19:47:48 +0000 Subject: Clarify name server records should be a hostname pointing to a A record --- packages/tinydns/tinydns.inc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'packages/tinydns/tinydns.inc') 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 */ -- cgit v1.2.3