+ if ( $soamachine ) {
+ my $soa = new FS::domain_record {
+ 'svcnum' => $self->svcnum,
+ 'reczone' => '@',
+ 'recaf' => 'IN',
+ 'rectype' => 'SOA',
+ 'recdata' => "$soamachine $soaemail ( ". time2str("%Y%m%e", time). "00 ".
+ "$soarefresh $soaretry $soaexpire $soadefaultttl )"
+ };
+ $error = $soa->insert;
+ warn "WARNING: couldn't insert SOA record for new domain: $error" if $error;
+
+ foreach my $nsmachine ( @nsmachines ) {
+ my $ns = new FS::domain_record {
+ 'svcnum' => $self->svcnum,
+ 'reczone' => '@',
+ 'recaf' => 'IN',
+ 'rectype' => 'NS',
+ 'recdata' => $nsmachine,
+ };
+ my $error = $ns->insert;
+ warn "WARNING: couldn't insert NS record for new domain: $error"
+ if $error;
+ }
+
+ foreach my $mxmachine ( @mxmachines ) {
+ my $mx = new FS::domain_record {
+ 'svcnum' => $self->svcnum,
+ 'reczone' => '@',
+ 'recaf' => 'IN',
+ 'rectype' => 'mx',
+ 'recdata' => $mxmachine,
+ };
+ my $error = $mx->insert;
+ warn "WARNING: couldn't insert MX record for new domain: $error"
+ if $error;
+ }
+
+ }
+
+