from ipaddress import IPv4Address, IPv6Address
from typing import List, Dict, Any, Iterator, Tuple, Sequence
from ipaddress import IPv4Address, IPv6Address
from typing import List, Dict, Any, Iterator, Tuple, Sequence
- def __init__(self, name: str, serialfile: str, dbfile: str, mail: str, NS: List[str],
+ def __init__(self, name: str, serialfile: str, mail: str, NS: List[str],
secondary_refresh: int, secondary_retry: int, secondary_expire: int,
NX_TTL: int = None, A_TTL: int = None, other_TTL: int = None,
domains: Dict[str, Any] = {}) -> None:
self._serialfile = serialfile
secondary_refresh: int, secondary_retry: int, secondary_expire: int,
NX_TTL: int = None, A_TTL: int = None, other_TTL: int = None,
domains: Dict[str, Any] = {}) -> None:
self._serialfile = serialfile
if not name.endswith('.'): raise Exception("Expected an absolute hostname")
self._name = check_hostname(name)
if not name.endswith('.'): raise Exception("Expected an absolute hostname")
self._name = check_hostname(name)
- with open(self._dbfile, 'w') as f:
- for rr in self.generate_rrs():
- f.write(rr+"\n")
- print(rr)
+ print(";; {0} zone file, generated by zonemaker <https://www.ralfj.de/projects/zonemaker> on {1}".format(self._name, datetime.datetime.now()))
+ for rr in self.generate_rrs():
+ print(rr)