mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2026-01-13 11:45:33 +08:00
Hello,
This pull request add the GeoDNS feature for ClouDNS.
Their API has 2 fields for adding a location, I choose to use only
"geodns-code" because it is more user-friendly.
Following the advice from @tlimoncelli the new metadata name is
``cloudns_geodns_code``
```
// Example syntax using geodns-code instead of geodns-location
A("test", "1.2.3.4", {cloudns_geodns_code: "US"});
A("test", "1.2.3.4", {cloudns_geodns_code: "FR"});
A("test", "1.2.3.4", {cloudns_geodns_code: "PL"});
```
More tests have been added and they all pass!
To compare two records, i have to replace the value "DEFAULT" with an
empty string temporary.
Their API always return "DEFAULT" as value by default instead of an
empty string for any dns record which uses their geodns feature.
```
// API return something like this if your account has GeoDNS and the dns record has GeoDNS
{"id":"XXXX","type":"A","host":"","record":"1.2.3.7","dynamicurl_status":0,"failover":"0","ttl":"300","geodns-location":"2","geodns-location-name":"Africa","geodns-location-code":"AFR","status":1}
// API return something like this if your account doesn't have GeoDNS feature or the dns record is not compatible with their GeoDNS
{"id":"XXXX","type":"TXT","host":"","record":"test","failover":"0","ttl":"3600","status":1}
```
If this implementation is good enough, i will update the documentation
("ClouDNS > Metadata section")
|
||
|---|---|---|
| .. | ||
| config | ||
| zones | ||
| helpers_integration_test.go | ||
| helpers_test.go | ||
| integration_test.go | ||
| profiles.json | ||
| provider_test.go | ||