1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

INWX: Paginate through Nameserver Records (#2609)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Joachim Schwarm
2023-11-01 18:34:34 +01:00
committed by GitHub
parent 65c47cbfe8
commit bf4118a041
2 changed files with 16 additions and 16 deletions

View File

@ -109,9 +109,3 @@ D("example.com", REG_INWX, DnsProvider(DSP_CF),
); );
``` ```
{% endcode %} {% endcode %}
{% hint style="info" %}
**NOTE**: The INWX provider implementation currently only supports up to 2,147,483,647 domains. If you exceed
this limit, it is expected that DNSControl will fail to recognize some domains. Should you exceed this
limit, please [open an issue on GitHub](https://github.com/StackExchange/dnscontrol/issues/new/choose).
{% endhint %}

View File

@ -395,18 +395,24 @@ func (api *inwxAPI) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.
// fetchNameserverDomains returns the domains configured in INWX nameservers // fetchNameserverDomains returns the domains configured in INWX nameservers
func (api *inwxAPI) fetchNameserverDomains() error { func (api *inwxAPI) fetchNameserverDomains() error {
zones := map[string]int{}
request := &goinwx.NameserverListRequest{} request := &goinwx.NameserverListRequest{}
request.PageLimit = 2147483647 // int32 max value, highest number API accepts page := 1
info, err := api.client.Nameservers.ListWithParams(request) for {
if err != nil { request.Page = page
return err info, err := api.client.Nameservers.ListWithParams(request)
if err != nil {
return err
}
for _, domain := range info.Domains {
zones[domain.Domain] = domain.RoID
}
if len(zones) >= info.Count {
break
}
page++
} }
api.domainIndex = zones
api.domainIndex = map[string]int{}
for _, domain := range info.Domains {
api.domainIndex[domain.Domain] = domain.RoID
}
return nil return nil
} }