Bob Hutchinson wrote:
On 23/08/04 15:40, Ryan White wrote:
I just got a report from a user to this effect:
I Added a MX record in the default domains. MX Record has distance 300 (looks fine in default domain manager)
When a new domain is added the default MX record has a distance of 0.
Although this works it's not the desired effect.
I reported this bug to this mailing list on 14/07/2004 here is the diff for my way of solving it:
here is a diff --- /var/vegadns-0.8.1/src/domains.php Fri Jun 18 04:45:48 2004 +++ /var/www/vegadns-0.8.1/src/domains.php Wed Jul 14 10:34:13 2004 @@ -257,11 +257,12 @@ while(list($key,$row) = each($records_array)) { $host = ereg_replace("DOMAIN", $domain, $row['host']); $val = ereg_replace("DOMAIN", $domain, $row['val']); - $q = "insert into records (domain_id,host,type,val,ttl) + $q = "insert into records (domain_id,host,type,val,distance,ttl) values('$id', '".mysql_escape_string($host)."', '".$row['type']."', '$val', + '".$row['distance']."', '".$row['ttl']."')"; mysql_query($q) or die(mysql_error()); dns_log($id, "added ".$row['type']." $host with value $val");
hope this helps...
(I tried upgrading to ver 8.1 but this did not solve the problem.)
I think this patch should fix it but maybe not all records need the distance copied across?
--- vegadns-0.8.1/src/domains.php Thu Jun 17 20:45:48 2004
+++ /vegadns-0.8.1-p/src/domains.php Mon Aug 23 07:25:11 2004
@@ -257,11 +257,12 @@
while(list($key,$row) = each($records_array)) {
$host = ereg_replace("DOMAIN", $domain, $row['host']);
$val = ereg_replace("DOMAIN", $domain, $row['val']);
- $q = "insert into records (domain_id,host,type,val,ttl)
+ $q = "insert into records (domain_id,host,type,val,distance,ttl)
values('$id',
'".mysql_escape_string($host)."',
'".$row['type']."',
'$val',
+ '".$row['distance']."',
'".$row['ttl']."')";
mysql_query($q) or die(mysql_error());
dns_log($id, "added ".$row['type']." $host with value $val");
This is already fixed in 0.9, which I have not yet posted. I'll get it posted as soon as possible.
Regards,
Bill
