Skip to content

Instantly share code, notes, and snippets.

@terrytrent
Created March 25, 2017 15:02
Show Gist options
  • Save terrytrent/8ad14b6993eabe26a4e2e20ce81943fc to your computer and use it in GitHub Desktop.
Save terrytrent/8ad14b6993eabe26a4e2e20ce81943fc to your computer and use it in GitHub Desktop.
from dns import query, update, tsigkeyring
from dns.tsig import HMAC_SHA256
key='EQSVvuA/KMAa/0ugdBBLqjxgP+o5rI7y8JoJbOICpJM='
bindhost='192.168.56.10'
ip='192.168.56.10'
keyring = tsigkeyring.from_text({
'test.local' : key
})
update = update.Update('test.local.', keyring=keyring, keyalgorithm=HMAC_SHA256)
update.replace('abc', 300, 'A', ip)
response = query.tcp(update, bindhost, timeout=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment