~ubuntu-branches/ubuntu/lucid/ebox-dns/lucid

« back to all changes in this revision

Viewing changes to stubs/db.mas

  • Committer: Bazaar Package Importer
  • Author(s): Javier Uruen Val, Javier Uruen Val
  • Date: 2010-02-07 18:51:11 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100207185111-qfo58di723initiu
Tags: 1.5-0ubuntu1
 [Javier Uruen Val]
 * New upstream release (LP: #521806)
 * debian/control
   - Bump eBox dependency
   - Add dependency on libcrypt-openssl-random-perl
   - Update description
   - Bump Standards-version to 3.8.4. No changes required.
 * debian/copyright: updated emails and dates.
 * debian/watch: fixed by adding /latest in the url

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
      mailExchangers - Array ref containing hash refs with the following elements:
16
16
         hostName - String the host's name which is a mail exchanger
17
17
         preference - Int the preference number for that MX record
 
18
      nameServers - Array ref containing the name servers for this domain
18
19
 
19
 
  nameserverHostname - String the nameserver host name
 
20
  nameserverHostname - String the name used as name server
20
21
</%doc>
21
22
<%args>
22
23
        %domain
26
27
my @time = localtime();
27
28
my $date = sprintf("%04d%02d%02d%02d",$time[5]+1900,$time[4]+1,$time[3],$time[2]);
28
29
my @hosts = @{$domain{'hosts'}};
 
30
my $firstNS = scalar(@{$domain{'nameServers'}}) == 0 ? $nameserverHostname : $domain{'nameServers'}->[0] ;
 
31
unless ($firstNS =~ /\.$/ ) {
 
32
   $firstNS = $firstNS . '.' . $domain{'name'} . '.';
 
33
}
29
34
</%init>
30
35
$TTL 3D
31
 
@       IN      SOA     <% $nameserverHostname %>.<% $domain{'name'} %>.        admin.example.com. (
 
36
@       IN      SOA     <% $firstNS %>  admin.example.com. (
32
37
                        <% $date %>     ;serial number
33
38
                        8H              ;refresh
34
39
                        2H              ;retry
35
40
                        4W              ;expiration
36
41
                        1D )            ;
37
42
;
38
 
                NS      <% $nameserverHostname %>.<% $domain{'name'} %>.        ;nameserver
 
43
% if ( @{$domain{'nameServers'}} == 0 ) {
 
44
                NS      <% $firstNS %>  ;nameserver
39
45
;
 
46
<% $firstNS %>          A       127.0.0.1
 
47
% } else {
 
48
%   foreach my $ns (@{$domain{'nameServers'}}) {
 
49
                NS      <% $ns %>
 
50
%   }
 
51
% }
40
52
% if($domain{'ipaddr'}) {       
41
53
                A       <% $domain{'ipaddr'} %>
42
54
% }
43
 
% unless (@hosts > 0 and (scalar(grep { $_->{'name'} eq $nameserverHostname } @hosts))) {
44
 
<% $nameserverHostname %>               A       127.0.0.1
45
55
<%perl>
46
 
  }
47
56
        if(@hosts != 0) {
48
57
                foreach my $host (@hosts) {
49
58
</%perl>