- Timestamp:
- 07/05/12 17:50:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tiny-import.pl
r356 r357 186 186 $zone =~ s/^\&//; 187 187 $zone =~ s/\.$//; 188 $ns =~ s/\.$//; 189 $ns = "$ns.ns.$fqdn" if $ns !~ /\./; 188 190 $ttl = 0 if !$ttl; 189 191 $stamp = '' if !$stamp; … … 206 208 if ($fparent) { 207 209 $recsth->execute($fparent, 0, $zone, 2, $ns, 0, 0, 0, $ttl); 210 $recsth->execute($fparent, 0, $ns, 2, $ip, 0, 0, 0, $ttl) if $ip; 208 211 } else { 209 212 push @deferred, $rec unless $nodefer; … … 268 271 } elsif ($rec =~ /^\@/) { 269 272 $cnt{MX}++; 273 274 my ($zone,$ip,$host,$dist,$ttl,$stamp,$loc) = split /:/, $rec, 7; 275 $zone =~ s/^\.//; 276 $zone =~ s/\.$//; 277 $host =~ s/\.$//; 278 $host = "$host.mx.$zone" if $host !~ /\./; 279 $ttl = 0 if !$ttl; 280 $stamp = '' if !$stamp; 281 $loc = '' if !$loc; 282 $loc = '' if $loc =~ /^:+$/; 283 284 # note we don't check for reverse domains here, because MX records don't make any sense in reverse zones. 285 # if this really ever becomes an issue for someone it can be expanded to handle those weirdos 286 287 # allow for subzone MXes, since it's perfectly legitimate to simply stuff it all in a single parent zone 288 my $domid = DNSDB::_hostparent($dbh, $zone); 289 if ($domid) { 290 $recsth->execute($domid, 0, $zone, 15, $host, $dist, 0, 0, $ttl); 291 $recsth->execute($domid, 0, $host, 1, $ip, 0, 0, 0, $ttl) if $ip; 292 } else { 293 push @deferred, $rec unless $nodefer; 294 } 270 295 271 296 } elsif ($rec =~ /^'/) {
Note:
See TracChangeset
for help on using the changeset viewer.