-p = subprocess.Popen(["/var/lib/bind/dyn-nsupdate", domain, password, ip], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+args = ["/var/lib/bind/dyn-nsupdate", "--domain", domain, "--password", password]
+if ip is not None:
+ args += ["--ipv4", ip]
+if ipv6 is not None:
+ args += ["--ipv6", ipv6]
+p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)