{
  use esmith::config;
  use esmith::db;

  my %dungog;
  tie %dungog, 'esmith::config', '/home/e-smith/db/dungog';

  my %domains;
  tie %domains, 'esmith::config', '/home/e-smith/db/domains';

  my $exlocal = db_get_prop(\%dungog, 'dansguardianf1', "exlocal") || 'off';
  unless ($exlocal eq 'on')
  {
    $OUT = '';

    #get records
    my @records = ();
    foreach (keys %domains)
    {
        push (@records, $_)
            if (db_get_type(\%domains, $_) eq "domain");
    }

    #if they have records add them to the templete
    my $records = @records || '0';
    if ($records > 0)
    {
      $OUT .= "\n";
      $OUT .= "#local domains\n";
      $OUT .= "# --------------------\n";
      
      foreach (sort @records)
      {
        $OUT .= "$_/server-manager\n";
        $OUT .= "$_/user-manager\n";
        $OUT .= "$_/user\n";
      }

      $OUT .= "\n";
    }
  }
}