salt.runners.ddns

Dynamic DNS Runner

Beryllium 新版功能.

Runner to interact with DNS server and create/delete/update DNS records

codeauthor:Nitin Madhok <nmadhok@clemson.edu>
salt.runners.ddns.add_host(zone, name, ttl, ip, keyname, keyfile, nameserver)

Create both A and PTR (reverse) records for a host.

CLI Example:

salt-run ddns.add_host domain.com my-test-vm 3600 10.20.30.40 my-tsig-key /etc/salt/tsig.keyring 10.0.0.1
salt.runners.ddns.create(zone, name, ttl, rdtype, data, keyname, keyfile, nameserver)

Create a DNS record. The nameserver must be an IP address and the master running this runner must have create privileges on that server.

CLI Example:

salt-run ddns.create domain.com my-test-vm 3600 A 10.20.30.40 my-tsig-key /etc/salt/tsig.keyring 10.0.0.1
salt.runners.ddns.delete(zone, name, keyname, keyfile, nameserver, rdtype=None, data=None)

Delete a DNS record.

CLI Example:

salt-run ddns.delete domain.com my-test-vm my-tsig-key /etc/salt/tsig.keyring 10.0.0.1 A
salt.runners.ddns.delete_host(zone, name, keyname, keyfile, nameserver)

Delete both forward (A) and reverse (PTR) records for a host only if the forward (A) record exists.

CLI Example:

salt-run ddns.delete_host domain.com my-test-vm my-tsig-key /etc/salt/tsig.keyring 10.0.0.1
salt.runners.ddns.update(zone, name, ttl, rdtype, data, keyname, keyfile, nameserver, replace=False)

Replace, or update a DNS record. The nameserver must be an IP address and the master running this runner must have update privileges on that server.

注解

If replace is set to True, all records for this name and type will first be deleted and then recreated. Default is replace=False.

CLI Example:

salt-run ddns.update domain.com my-test-vm 3600 A 10.20.30.40 my-tsig-key /etc/salt/tsig.keyring 10.0.0.1