/usr/share/gforge/bin/dns_conf.pl is in gforge-dns-bind9 5.3.2+20141104-3+deb8u3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/usr/bin/perl
use DBI;
use POSIX qw(strftime);
my $source_path = `forge_get_config source_path`;
chomp $source_path;
require ("$source_path/lib/include.pl") ; # Include all the predefined functions
&db_connect;
@dns_zone = open_array_file($file_dir."/bind/dns.head");
#
# Update the Serial Number
#
$date_line = $dns_zone[5];
$date_line =~ s/\t\t\t/\t/;
($blah,$date_str,$comments) = split(" ", $date_line);
$date = $date_str;
$serial = substr($date, 8, 2);
$old_day = substr($date, 6, 2);
$serial++;
$now_string = strftime "%Y%m%d", localtime;
$new_day = substr($now_string, 6, 2);
if ($old_day != $new_day) { $serial = "01"; }
$new_serial = $now_string.$serial;
$dns_zone[5] = " $blah $new_serial $comments";
write_array_file($file_dir."/bind/dns.head", @dns_zone);
#
# grab Table information
#
my $query = "SELECT http_domain,unix_group_name,group_name,unix_box FROM groups WHERE http_domain LIKE '%.%' AND status = 'A'";
my $c = $dbh->prepare($query);
$c->execute();
while(my ($http_domain,$unix_group_name,$group_name,$unix_box) = $c->fetchrow()) {
($name, $aliases, $addrtype, $length, @addrs) = gethostbyname("$unix_box".".".$sys_default_domain );
@blah = unpack('C4', $addrs[0]);
$ip = join(".", @blah);
if ($ip){
push @dns_zone, sprintf("%-24s%-16s",$unix_group_name,"IN\tA\t" . "$ip\n");
# Does not work with bind9 or bad syntax ???
#push @dns_zone, sprintf("%-24s%-28s","", "IN\tMX\t" . "mail." . $sys_default_domain . ".\n");
push @dns_zone, sprintf("%-24s%-20s","cvs.".$unix_group_name,"IN\tCNAME\t".$sys_scm_host.".\n\n");
} else {
push @dns_zone, sprintf("; Could not get ip for %s","$unix_box".".".$sys_default_domain."\n");
}
}
write_array_file($file_dir."/bind/dns.zone", @dns_zone);
|