test
This commit is contained in:
parent
7e2919a59d
commit
8fc198d064
@ -116,6 +116,7 @@ def main() -> int:
|
|||||||
|
|
||||||
# Convert to a zone file
|
# Convert to a zone file
|
||||||
print(f"$ORIGIN {args.zone}.")
|
print(f"$ORIGIN {args.zone}.")
|
||||||
|
print(f"$TTL {args.ttl}")
|
||||||
print(f"@ IN SOA ns.{args.zone}. noc.ewpratten.com. 1 3600 600 86400 60")
|
print(f"@ IN SOA ns.{args.zone}. noc.ewpratten.com. 1 3600 600 86400 60")
|
||||||
|
|
||||||
# Add the hosts
|
# Add the hosts
|
||||||
@ -129,11 +130,11 @@ def main() -> int:
|
|||||||
# Add forward and reverse records
|
# Add forward and reverse records
|
||||||
for address in addresses:
|
for address in addresses:
|
||||||
if isinstance(address, ipaddress.IPv4Address):
|
if isinstance(address, ipaddress.IPv4Address):
|
||||||
print(f"{host}. {args.ttl} IN A {address}.")
|
print(f"{host}. IN A {args.ttl} {address}.")
|
||||||
print(f"{address.reverse_pointer}. {args.ttl} IN PTR {host}.")
|
print(f"{address.reverse_pointer}. {args.ttl} IN PTR {host}")
|
||||||
elif isinstance(address, ipaddress.IPv6Address):
|
elif isinstance(address, ipaddress.IPv6Address):
|
||||||
print(f"{host}. {args.ttl} IN AAAA {address}.")
|
print(f"{host}. {args.ttl} IN AAAA {address}.")
|
||||||
print(f"{address.reverse_pointer}. {args.ttl} IN PTR {host}.")
|
print(f"{address.reverse_pointer}. {args.ttl} IN PTR {host}")
|
||||||
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user