How to delete a dyanmic DNS record using Python or Bash? -


the following code in python updates

import dns.query import dns.tsigkeyring import dns.update import sys  keyring = dns.tsigkeyring.from_text({'host-example.' : 'xxxxxxxxxxxxxxxxxxxxxx=='})  update = dns.update.update('dyn.test.example', keyring=keyring) update.replace('host', 300, 'a', sys.argv[1])   response = dns.query.tcp(update, '10.0.0.1') 

but not find out how remove dns entry.

the delete() method of dns.update.update can used delete record.

import dns.query import dns.tsigkeyring import dns.update  keyring = dns.tsigkeyring.from_text({'host-example.' : 'xxxxxxxxxxxxxxxxxxxxxx=='}) update = dns.update.update('dyn.test.example', keyring=keyring) update.delete('host', 'a') response = dns.query.tcp(update, '10.0.0.1') 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -