Commit f6696a7d authored by Sigmund Augdal's avatar Sigmund Augdal

Allow creating dns records that have the same name as the domain they are in

parent 60fb1a0e
......@@ -23,14 +23,17 @@ def parse_args():
def main(args):
domain = args.record.split(".", 1)[1]
conf = SafeConfigParser()
conf.read(args.config)
dns = dns_rr.client_from_conf(conf)
domain = args.record
domain_id = dns.get_domain_id(domain)
if not domain_id:
print("Unknown domain {}".format(domain))
return
domain = domain.split(".", 1)[1]
domain_id = dns.get_domain_id(domain)
if not domain_id:
print("Unknown domain {}".format(domain))
return
record = dict(name=args.record, type=args.type, content=args.content, domain_id=domain_id,
ttl=int(args.ttl))
if not dns.create_record(record):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment