#!/usr/bin/perl

use strict;

my $ip = $ARGV[0];
my $start = $ARGV[1];
my $end = $ARGV[2];
my $name = $ARGV[3];
my $i=0;

for (my $j=$start; $j <=$end; $j++) {
  print "INSERT INTO records (domain_id, name,type,content,ttl,prio,tupasorting) select id, '$j.$ip', 'PTR', '$j.$name',86400, 0, $i from domains where name='$ip';\n";
  $i++;
}
