From 361a49efe6100bc705cfd0d53d09f45ca54842ec Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 6 Feb 2007 23:22:30 +0000 Subject: Add rDNS and show the IP address in the column list Submitted-by: GAndreone@imapro.com --- packages/tinydns/tinydns.inc | 21 ++++++++++++++++----- packages/tinydns/tinydns_domains.xml | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) (limited to 'packages/tinydns') diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc index 7a27ca4c..97b30fd5 100644 --- a/packages/tinydns/tinydns.inc +++ b/packages/tinydns/tinydns.inc @@ -279,7 +279,7 @@ function tinydns_create_zone_file() { log_error("tinydns_get_backup_record returned $ipaddress "); } } - $record_data = tinydns_get_rowline_data($ipaddress, $domain['recordtype'], $ttl, $hostname); + $record_data = tinydns_get_rowline_data($ipaddress, $domain['recordtype'], $ttl, $hostname, $domain['rdns']); if($record_data) { fwrite($fd, $record_data . "\n"); } @@ -313,7 +313,8 @@ function tinydns_create_zone_file() { } /* formats data as a tinydns data row item */ -function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname) { +/* A full description of the data format is available at 'man tinydns-data' */ +function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname,$rdns) { if($ttl) $ttl_string = ":{$ttl}"; else @@ -325,15 +326,25 @@ function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname) { case "MX": $record_data = "@{$hostname}:{$recordip}::{$ttl_string}"; break; - case "A": - $record_data = "+{$hostname}:{$recordip}{$ttl_string}"; - break; case "PTR": + /* "^" creates "PTR" record only to allow reverse DNS */ + $record_data = "^{$hostname}:{$recordip}{$ttl_string}"; + break; + case "A": + /* "=" creates both "A" and "PTR" records to allow both forward and reverse DNS */ + if($rdns) $record_data = "={$hostname}:{$recordip}{$ttl_string}"; + else + /* "+" creates "A" records only to allow forward DNS */ + $record_data = "+{$hostname}:{$recordip}{$ttl_string}"; break; case "CNAME": $record_data = "C{$hostname}:{$recordip}{$ttl_string}"; break; + case "TXT": + /* "'" creates "TXT" record that can be used for SPF */ + $record_data = "'{$hostname}:{$recordip}{$ttl_string}"; + break; } return $record_data; } diff --git a/packages/tinydns/tinydns_domains.xml b/packages/tinydns/tinydns_domains.xml index acb39e8b..48466b8d 100644 --- a/packages/tinydns/tinydns_domains.xml +++ b/packages/tinydns/tinydns_domains.xml @@ -32,11 +32,19 @@ Record type recordtype + + rDNS + rdns + + + IP Address + ipaddress + hostname - Domain name. Example: www.exampledomain.com + FQDN or Hostname www.exampledomain.com Enter the domain name that you would like to serve dns records for. input @@ -58,6 +66,12 @@ + + Automatic PTR entry + rdns + Create a reverse DNS (PTR) entry for this A record? + checkbox + ipaddress IP Address or hostname that record points to @@ -129,3 +143,4 @@ tinydns_setup_ping_items(); + -- cgit v1.2.3