diff options
Diffstat (limited to 'config/tinydns')
-rw-r--r-- | config/tinydns/tinydns.inc | 10 | ||||
-rw-r--r-- | config/tinydns/tinydns_domains.xml | 33 |
2 files changed, 40 insertions, 3 deletions
diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 501c019d..6bdf71ba 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -535,7 +535,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, $domain['rdns'], $dist); + $record_data = tinydns_get_rowline_data($ipaddress, $domain['recordtype'], $ttl, $hostname, $domain['rdns'], $dist, $domain['src_port'], $domain['src_weight'], $domain['src_priority'], $domain['src_timestamp']); if($record_data) { fwrite($fd, $record_data . "\n"); if ($domain['rdns'] || ($domain['recordtype'] == 'PTR')) { @@ -558,7 +558,7 @@ function tinydns_create_zone_file() { $wanpingthreshold = ""; $status = tinydns_get_record_status($row['failoverip'], $pingthreshold, $wanpingthreshold); if($status == "DOWN") { - $record_data = tinydns_get_rowline_data($row['failoverip'], $domain['recordtype'], $ttl, $hostname, ""); + $record_data = tinydns_get_rowline_data($row['failoverip'], $domain['recordtype'], $ttl, $hostname, "", $domain['rdns'], $dist, $domain['src_port'], $domain['src_weight'], $domain['src_priority'], $domain['src_timestamp']); fwrite($fd, $record_data . "\n"); } } @@ -696,7 +696,7 @@ function tinydns_do_xmlrpc_sync($sync_to_ip, $password) { } /* formats data as a tinydns data row item */ -function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname, $rdns, $dist) { +function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname, $rdns, $dist, $srv_port = "5000", $srv_weight = "0", $srv_priority = "0", $srv_timestamp = "1") { if($ttl) $ttl_string = ":{$ttl}"; else @@ -760,6 +760,10 @@ function tinydns_get_rowline_data($recordip, $recordtype, $ttl, $hostname, $rdns $record_data = "6{$hostname}:{$recip_san}{$ttl_string}"; } break; + case "SRV": + $recip_san = str_replace(":", "", $recordip); + $record_data = "S{$hostname}:{$recip_san}{$rec_port}{$rec_weight}{$srv_priority}{$ttl_string}{$srv_timestamp}"; + break; case "CNAME": // Cfqdn:p:ttl:timestamp:lo $record_data = "C{$hostname}:{$recordip}{$ttl_string}"; diff --git a/config/tinydns/tinydns_domains.xml b/config/tinydns/tinydns_domains.xml index 6c1cdc6e..9e4238de 100644 --- a/config/tinydns/tinydns_domains.xml +++ b/config/tinydns/tinydns_domains.xml @@ -175,6 +175,7 @@ <option><name>MX</name><value>MX</value></option> <option><name>NS</name><value>NS</value></option> <option><name>SOA</name><value>SOA</value></option> + <option><name>SRV</name><value>SRV</value></option> <option><name>PTR</name><value>PTR</value></option> <option><name>CNAME</name><value>CNAME</value></option> <option><name>TXT</name><value>TXT</value></option> @@ -200,8 +201,40 @@ <fieldname>ttl</fieldname> <type>input</type> <size>35</size> + </field> + <field> + <fielddescr>(SRV) Server record port</fielddescr> + <fieldname>srv_port</fieldname> + <type>input</type> + <size>35</size> + </field> + <field> + <fielddescr>(SRV) Server record weight</fielddescr> + <fieldname>srv_weight</fieldname> + <type>input</type> + <size>35</size> + </field> + <field> + <fielddescr>(SRV) Server record timestamp</fielddescr> + <fieldname>srv_timestamp</fieldname> + <type>input</type> + <size>35</size> + </field> + <field> + <fielddescr>DNS record time to live (in seconds)</fielddescr> + <fieldname>ttl</fieldname> + <type>input</type> + <size>35</size> </field> <field> + <fielddescr>DNS record time to live (in seconds)</fielddescr> + <fieldname>ttl</fieldname> + <type>input</type> + <size>35</size> + </field> + + + <field> <type>listtopic</type> <name>Reverse lookup</name> <fieldname>temp</fieldname> |