diff --git a/DynDnsBot.js b/DynDnsBot.js index ff35377..7cb7df4 100644 --- a/DynDnsBot.js +++ b/DynDnsBot.js @@ -15,7 +15,7 @@ export class DynDnsBot{ Object.keys(this.config.records).forEach(domain => { this.config.records[domain].forEach(record => { record.target = newIp; - this.dns.updateRecord(record, domain); + this.dns.updateRecord(record, domain).then(()=>this.dns.refreshZone(domain)); }) }); } diff --git a/OvhApi.js b/OvhApi.js index fc1fdf9..b41293d 100644 --- a/OvhApi.js +++ b/OvhApi.js @@ -93,7 +93,7 @@ export class OvhApi{ return await this.sendSignedRequest({ path: `/domain/zone/${domain}/record/${id}`, getMethod: rest=>rest.put, - body: {subDomain, target, ttl, fieldType} + body: {subDomain, target, ttl} }); } @@ -118,4 +118,11 @@ export class OvhApi{ path: `/domain/zone/${domain}/record/${id}` }); } + + async refreshZone(zone){ + return await this.sendSignedRequest({ + path: `/domain/zone/${zone}/refresh`, + getMethod: rest=>rest.post + }); + } } \ No newline at end of file