diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-02-06 23:22:30 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-02-06 23:22:30 +0000 |
commit | 361a49efe6100bc705cfd0d53d09f45ca54842ec (patch) | |
tree | bb8bd463075bce19fcb9d30ac9bedf6861e5af7c /packages/tinydns/tinydns.inc | |
parent | 995059950fe3b708b895d4063e24315451a5d8e8 (diff) | |
download | pfsense-packages-361a49efe6100bc705cfd0d53d09f45ca54842ec.tar.gz pfsense-packages-361a49efe6100bc705cfd0d53d09f45ca54842ec.tar.bz2 pfsense-packages-361a49efe6100bc705cfd0d53d09f45ca54842ec.zip |
Add rDNS and show the IP address in the column list
Submitted-by: GAndreone@imapro.com
Diffstat (limited to 'packages/tinydns/tinydns.inc')
-rw-r--r-- | packages/tinydns/tinydns.inc | 21 |
1 files changed, 16 insertions, 5 deletions
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; } |