<p>You can use dns.resolver or dns.rdatatype and update in Python like below: </p>

<pre><code>import dns.resolver
import dns.rdatatype
import dns.update

for i in dns.resolver.query('blah.com', 'TXT').answer.response:
   update.replace(% i , 60, dns.rdatatype.TXT, '" NEW RECORD"')
</code></pre>

CC BY-SA 4.0
2018-08-09T08:29:02.007Z
2018-08-09T08:29:02.007Z
lORD
<p>Amazon web services provides such a service,  called Route53. You can actually use REST calls,  but it is much easier to use their command line tools or bindings for PHP,  Python or JavaScript. </p>

<p>Here is an entry point to get you started, the route53 change resource record sets call can be used to update or insert  one or many records on a domain.
 <a href="https://docs.aws.amazon.com/cli/latest/reference/route53/change-resource-record-sets.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/cli/latest/reference/route53/change-resource-record-sets.html</a></p>

<p>Of course you need to create an account, set up permissions and delegate name servers to route53.</p>

<p>It's also not free,  but fairly cheap at $0.50 for first 25 domains, then $0.10 after.  All charges per month. </p>

CC BY-SA 4.0
2018-08-14T01:25:39.293Z
You can use CNAME for that DKIM record so you only need (and pay for) one domain (zone) in AWS Route 53 where the TXT records will be managed and use CNAMEs to point to those records from the "business" domains.
Messa
CC BY-SA 4.0
2018-08-14T01:26:37.057Z
For example here is the Python API (library called boto3) for AWS: https://boto3.readthedocs.io/en/latest/reference/services/route53.html
Messa
CC BY-SA 4.0
2018-08-09T07:44:23.713Z
2018-08-09T07:44:23.713Z
jdog
<p>I manually update the DNS settings at the registrar for my domains, such as</p>

<pre><code>https://domains.google.com/registrar
</code></pre>

<p>What are people using to automate updates to DNS settings? which registrars have an API ?</p>

<p>Specifically I need to manually update : </p>

<ul>
<li><p>TXT field for the DKIM setting</p></li>
<li><p>TXT field for spf  </p>

<p>@                  TXT          1m       "v=spf1 ip4:100.22.22.100 include:blah.com -all"</p></li>
<li><p>A record everytime I change external IP</p></li>
</ul>

<p>To run my own DNS host servers seems like overkill. Ideally I would just make some secure REST call to perform programmatic updates.</p>

<dns>
DNS hosting choices - how to programmatically update DNS settings
Scott Stensland
# DNS hosting choices - how to programmatically update DNS settings

(Asked by: username_0 on 2018-08-08)

I manually update the DNS settings at the registrar for my domains, such as
https://domains.google.com/registrar

What are people using to automate updates to DNS settings? which registrars have an API ?
Specifically I need to manually update : 

TXT field for the DKIM setting
TXT field for spf  
@                  TXT          1m       "v=spf1 ip4:100.22.22.100 include:blah.com -all"
A record everytime I change external IP

To run my own DNS host servers seems like overkill. Ideally I would just make some secure REST call to perform programmatic updates.

**Tags:** dns


---

## 2 answers

### Answer by username_1 on 2018-08-09. Score: 1

You can use dns.resolver or dns.rdatatype and update in Python like below: 
import dns.resolver
import dns.rdatatype
import dns.update

for i in dns.resolver.query('blah.com', 'TXT').answer.response:
   update.replace(% i , 60, dns.rdatatype.TXT, '" NEW RECORD"')


---

### Answer by username_2 on 2018-08-09. Score: 1

Amazon web services provides such a service, called Route53. You can actually use REST calls, but it is much easier to use their command line tools or bindings for PHP, Python or JavaScript.

Here is an entry point to get you started, the route53 change resource record sets call can be used to update or insert one or many records on a domain.
<https://docs.aws.amazon.com/cli/latest/reference/route53/change-resource-record-sets.html>

Of course you need to create an account, set up permissions and delegate name servers to route53.

It's also not free, but fairly cheap at $0.50 for first 25 domains, then $0.10 after. All charges per month.

> **Comments:**
> **username_3**: You can use CNAME for that DKIM record so you only need (and pay for) one domain (zone) in AWS Route 53 where the TXT records will be managed and use CNAMEs to point to those records from the "business" domains.  
> **username_3**: For example here is the Python API (library called boto3) for AWS: https://boto3.readthedocs.io/en/latest/reference/services/route53.html  

---

