{ # vim: ft=perl # (C) 2006 neddix, Michael Weinberger %hostlist=( # after modifying the config section run these commands: # # expand-template /var/service/tinydns/root/data # cd /var/service/tinydns/root/ # tinydns-data # svc -t /service/tinydns # svc -t /service/dnscache ### config section starts here ### "mars.contribs.org" => "194.145.64.36", # sample 1 "zeus.contribs.org" => "66.135.192.71", # sample 2 ### config section ends here ### ); $ddb = esmith::DomainsDB->open(); @customadded=$ddb->get_all_by_prop("type"=>"domain-remote", "customadded"=>'yes'); foreach $domain (sort @customadded) { $domain->delete; } while( ($FQHOST,$HOSTIP) = each( %hostlist ) ) { $OUT .= "### $FQHOST\n"; $OUT .= ".$FQHOST\:\:$HOSTIP\n"; $OUT .= "=$FQHOST:$HOSTIP\n\n"; $rec = $ddb->get($FQHOST); $rec ||= $ddb->new_record($FQHOST, { type => 'domain-remote' }) if( !$rec ); %props=( "Nameservers"=>"localhost", "customadded"=>"yes" ); $rec->merge_props(%props); } }