From 726a5696bd4d5cb20d21709a4045b27005dd5306 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 29 Sep 2013 02:00:15 +0200 Subject: [PATCH] added docstring --- nsupdate/main/dnstools.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nsupdate/main/dnstools.py b/nsupdate/main/dnstools.py index c7aeaac..eb11198 100644 --- a/nsupdate/main/dnstools.py +++ b/nsupdate/main/dnstools.py @@ -21,6 +21,15 @@ class SameIpError(ValueError): def update(fqdn, ipaddr, ttl=60): + """ + intelligent dns updater - first does a lookup on the master server to find + the current ip and only sends a dynamic update if we have a different ip. + + :param fqdn: fully qualified domain name (str) + :param ipaddr: new ip address + :param ttl: time to live, default 60s (int) + :raises: SameIpError if new and old IP is the same + """ af = dns.inet.af_for_address(ipaddr) rdtype = 'A' if af == dns.inet.AF_INET else 'AAAA' try: