fix zonefile

This commit is contained in:
Peter Hormanns 2019-06-18 19:06:10 +02:00
parent 54139ec1f5
commit 13f1552ad2
2 changed files with 12 additions and 5 deletions

View File

@ -140,6 +140,13 @@ public class PacProcessorFactory implements EntityProcessorFactory {
private Processor createZonefileProc(final EntityManager em, final Pac pac) {
final Map<String, Object> zonefileTemplateVars = new HashMap<String, Object>();
zonefileTemplateVars.put("sio", Long.toString(System.currentTimeMillis()/1000L));
zonefileTemplateVars.put("pac", pac.getName());
zonefileTemplateVars.put("inet4Addr", pac.getCurINetAddr().getInet4Addr());
try {
zonefileTemplateVars.put("inet6Addr", pac.getCurINetAddr().getInet6Addr());
} catch (ProcessorException e) {
// dont care
}
final String domName = pac.getName() + ".hostsharing.net";
final String zonefileTargetPath = "/etc/bind/pri." + domName;
final Processor zonefileTemplateProcessor =

View File

@ -7,9 +7,9 @@ ${pac.name}.hostsharing.net. IN SOA ${hive}.hostsharing.net. hostmaster.hostshar
1H ; minimum
)
${pac.name}.hostsharing.net. IN NS dns1.hostsharing.net.
${pac.name}.hostsharing.net. IN NS dns2.hostsharing.net.
${pac.name}.hostsharing.net. IN NS dns3.hostsharing.net.
${pac}.hostsharing.net. IN NS dns1.hostsharing.net.
${pac}.hostsharing.net. IN NS dns2.hostsharing.net.
${pac}.hostsharing.net. IN NS dns3.hostsharing.net.
${pac.name}.hostsharing.net. IN A ${pac.curINetAddr.inet4Addr}
${pac.name}.hostsharing.net. IN AAAA ${pac.curINetAddr.inet6Addr}
${pac}.hostsharing.net. IN A ${inet4Addr}
${pac}.hostsharing.net. IN AAAA ${inet6Addr}