salt.runners.ddns

Dynamic DNS Runner

New in version 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, timeout, port=53, keyalgorithm=u'hmac-md5')

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 5
salt.runners.ddns.create(zone, name, ttl, rdtype, data, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm=u'hmac-md5')

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 5
salt.runners.ddns.delete(zone, name, keyname, keyfile, nameserver, timeout, rdtype=None, data=None, port=53, keyalgorithm=u'hmac-md5')

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 5 A
salt.runners.ddns.delete_host(zone, name, keyname, keyfile, nameserver, timeout, port=53, keyalgorithm=u'hmac-md5')

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 5
salt.runners.ddns.update(zone, name, ttl, rdtype, data, keyname, keyfile, nameserver, timeout, replace=False, port=53, keyalgorithm=u'hmac-md5')

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.

Note

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 5