From 56416734d9b79d016059a85852886deb83af1c28 Mon Sep 17 00:00:00 2001 From: toinux <26522723+itzwam@users.noreply.github.com> Date: Sat, 25 Apr 2026 17:53:46 +0200 Subject: [PATCH 1/2] fix: Python3 exec --- script/settings.py | 2 +- script/setup.py | 2 +- script/syndns.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/settings.py b/script/settings.py index 204ce47..8d35916 100755 --- a/script/settings.py +++ b/script/settings.py @@ -47,7 +47,7 @@ zones_path = os.path.join(named_path, 'zones') -system = platform.dist()[0] +system = platform.freedesktop_os_release()['VENDOR_NAME'] if system == 'centos': user = 'named' sysconf = '/etc/sysconfig/named' diff --git a/script/setup.py b/script/setup.py index 2845f38..13bb7d0 100755 --- a/script/setup.py +++ b/script/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #-*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 diff --git a/script/syndns.py b/script/syndns.py index f4a640a..eddd988 100755 --- a/script/syndns.py +++ b/script/syndns.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 #-*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 From 7d2c30891da8a36d1964bbaaaed4a2795a1de8c4 Mon Sep 17 00:00:00 2001 From: toinux <26522723+itzwam@users.noreply.github.com> Date: Sat, 25 Apr 2026 17:55:26 +0200 Subject: [PATCH 2/2] fix: NixOS rndc.conf --- rndc.conf | 7 +++++++ script/syndns.py | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 rndc.conf diff --git a/rndc.conf b/rndc.conf new file mode 100644 index 0000000..ad31f18 --- /dev/null +++ b/rndc.conf @@ -0,0 +1,7 @@ +include "rndc.key"; + +options { + default-key "rndc-key"; + default-server 127.0.0.1; + default-port 953; +}; diff --git a/script/syndns.py b/script/syndns.py index eddd988..b9f24f1 100755 --- a/script/syndns.py +++ b/script/syndns.py @@ -100,9 +100,9 @@ def reload_slave(slave_ip, system): sys.exit(-1) # reload slave dns - rndc_conf = '%s/rndc.key' % settings.named_path + rndc_conf = '%s/rndc.conf' % settings.named_path code = subprocess.call('/usr/bin/ssh %s@%s ' - '/usr/sbin/rndc -k %s -s localhost reload' % + '/usr/sbin/rndc -c %s -s localhost reload' % (user, slave_ip, rndc_conf), shell=True) if code: sys.stderr.write('reload slave name server %s failed\n' % slave_ip) @@ -138,8 +138,8 @@ def main(): settings.master_ip) for z in zones])) # reload master dns - rndc_conf = '%s/rndc.key' % settings.named_path - code = subprocess.call('/usr/sbin/rndc -k %s -s localhost reload' % + rndc_conf = '%s/rndc.conf' % settings.named_path + code = subprocess.call('/usr/sbin/rndc -c %s -s localhost reload' % rndc_conf, shell=True) if code: sys.stderr.write('reload master name server failed\n')