From 90a558152c16e547b079091c3a36d1da8ddebdfd Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 4 Mar 2018 18:40:37 +0800 Subject: filter/dns: next_serial checks drill and dig --- filter_plugins/dns.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'filter_plugins') diff --git a/filter_plugins/dns.py b/filter_plugins/dns.py index 9fdca29..5b26b29 100644 --- a/filter_plugins/dns.py +++ b/filter_plugins/dns.py @@ -36,8 +36,13 @@ def run_query(cmd, rtype, fqdn, ns=None): def next_serial(fqdn): - cmd = "drill" - cmd_path = which(cmd) + """ + Generate the next serial number for the DNS SOA record. + """ + for cmd in ["drill", "dig"]: + cmd_path = which(cmd) + if cmd_path: + break if cmd_path is None: raise Exception("Cannot find %s" % cmd) -- cgit v1.2.2