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 +++++++++++--------- packages/tinydns/tinydns_domains.xml | 12 +++++++++++- 2 files changed, 22 insertions(+), 10 deletions(-) (limited to 'packages') 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 @@ - Failover Threshhold + ipaddress + IP Address or hostname that record points to + 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. + + input + + + Threshhold Time in minutes before DNS switches to backup host input @@ -59,4 +66,7 @@ + + tinydns_create_zone_file(); + -- cgit v1.2.3