github.com/StackExchange/dnscontrol/v4@v4.11.0/documentation/provider/loopia.md (about) 1 Loopia is a 💩 provider of DNS. Using DNSControl hides some of the 💩. 2 If you are stuck with Loopia, hopefully this will reduce the pain. 3 4 They provide DNS services, both as a registrar, and a provider. 5 They provide support in English and other regional variants (Norwegian, Serbian, Swedish). 6 7 This plugin is based on API documents found at 8 [https://www.loopia.com/api/](https://www.loopia.com/api/) 9 and by observing API responses. Hat tip to GitHub @hazzeh whose code for the 10 LEGO Loopia implementation was helpful. 11 12 Sadly the Loopia API has some problems: 13 * API calls are limited to 60 calls per minute. If you go above this, 14 you will have to wait before you can make changes. 15 * When rate-limited, you will not receive a single HTTP 16 error: The errors propagate from the back-end, with no headers, or 17 Retry-After or anything useful. 18 * There are no guarantees of idempotency from their API. 19 20 ## Unimplemented API methods 21 22 * `removeDomain` is not implemented for safety reasons. Should you wish to remove 23 a domain, do so from the Loopia control panel. 24 * `addDomain` 25 * `transferDomain` (to Loopia) 26 27 This effectively means that this plugin does not access registrar functions. 28 29 ## Errors 30 31 You may occasionally see this error 32 ```text 33 HTTP Post Error: Post "https://api.loopia.se/RPCSERV": context deadline exceeded (Client.Timeout exceeded while awaiting headers) 34 ``` 35 36 The API endpoint didn't answer. Try again. 🤷 37 38 39 ## Configuration 40 41 To use this provider, add an entry to `creds.json` with `TYPE` set to `LOOPIA` 42 along with your Loopia API login credentials. 43 44 Example: 45 46 {% code title="creds.json" %} 47 ```json 48 { 49 "loopia": { 50 "TYPE": "LOOPIA", 51 "username": "your-loopia-api-account-id@loopiaapi", 52 "password": "your-loopia-api-account-password", 53 "debug": "true" // Set to true for extra debug output. Remove or set to false to prevent extra debug output. 54 } 55 } 56 ``` 57 {% endcode %} 58 59 ### Variables 60 61 * `username` - string - your @loopiaapi created username 62 * `password` - string - your loopia API password 63 * `debug` - string - Set to true for extra debug output. Remove or set to false to prevent extra debug output. 64 * `rate_limit_per` - string - See [Rate Limiting](#rate-limiting) below. 65 * `region` - string - See [Regions](#regions) below. 66 * `modify_name_servers` - string - See [Modify Name Servers](#modify-name-servers) below. 67 * `fetch_apex_ns_entries` - string - See [Fetch NS Entries](#fetch-apex-ns-entries) below. 68 69 There is no test endpoint. Fly free, grasshopper. 70 71 Turning on debug will show the XML requests and responses, and include the 72 username and password from your `creds.json` file. If you want to share these, 73 like for a GitHub issue, be sure to redact those from the XML. 74 75 ### Fetch Apex NS Entries 76 77 `creds.json` setting: `fetch_apex_ns_entries` 78 79 ... or use locally hard-coded variables: 80 81 ```go 82 defaultNS1 = "ns1.loopia.se." 83 defaultNS2 = "ns2.loopia.se." 84 ``` 85 86 API calls to loopia can be expensive time-wise. Set this to "false" (off) to 87 skip the API call to fetch the apex (`@`) entries, and use Loopia's default NS 88 servers. 89 90 This setting defaults to "true" (on). 91 92 ### Modify Name Servers 93 94 `creds.json` setting: `modify_name_servers` 95 96 Setting this to "true" (on) allows you to modify NS entries. 97 98 Loopia is weird. NS entries are inaccessible in the control panel. But you can see them. 99 Perhaps dnscontrol added an NS that you cannot delete now? Toggle this setting to 100 "true" in order to treat all NS entries as any other - making them accessible 101 to modification. Beware the consequences of changing from default NS entries. Likely 102 nothing will happen since the glue records provided won't match those in the domain, 103 and you will need to manually inform Loopia of this so they can update the glue records. 104 105 In short: enable this setting to be able to delete NS entries. No `NS()` in your 106 `dnsconfig.js`? Existing ones will be deleted. Have some `NS()` or `NAMESERVER()` 107 entries? They'll be added. 108 109 This setting defaults to "false" (off). 110 111 112 ### Regions 113 114 `creds.json` setting: `region` 115 116 117 Loopia operate in a few regions. Norway (`no`), Serbia (`rs`), Sweden (`se`). 118 119 For the parameter `region`, specify one of `no`, `rs`, `se`, or omit, or leave empty for the default `se` Sweden. 120 121 As of writing, `no` was broken 💩 and produced: 122 123 ```text 124 HTTP Post Error: Post "https://api.loopia.no/RPCSERV": x509: “*.loopia.rs” certificate name does not match input 125 ``` 126 127 ### Rate Limiting 128 129 `creds.json` setting: `rate_limit_per` 130 131 132 Loopia rate limits requests to 60 per minute. 133 134 From their [web-site](https://www.loopia.com/api/rate_limiting/): 135 ```text 136 You can make up to 60 calls per minute to LoopiaAPI. Of those, a maximum of 15 can be domain searches. 137 ``` 138 139 Depending on how many requests you make, you may encounter a limit. Modification 140 of each DNS record requires at least one API call. 🤦 141 142 Example: If the rate is 60/min and you make two requests every second, the 31st 143 request will be rejected. You will then have to wait for 29 seconds, until the 144 first request’s age reaches one minute. At that time, it will be dropped from 145 the calculation, and you can make another request. One second later, and 146 generally every time an old request’s age falls out of the sliding window 147 counting interval, you can make another request. 148 149 Your per minute quota is 60 requests and in your settings you 150 specified `Minute`. DNSControl will perform at most one request per second. 151 DNSControl will emit a warning in case it breaches the quota. 152 153 The setting `rate_limit_per` controls this behavior and accepts 154 a case-insensitive value of 155 - `Hour` 156 - `Minute` 157 - `Second` 158 159 The default for `rate_limit_per` is `Second`. 160 161 In your `creds.json` for all `LOOPIA` provider entries: 162 163 {% code title="creds.json" %} 164 ```json 165 { 166 "loopia": { 167 "TYPE": "LOOPIA", 168 "username": "your-loopia-api-account-id@loopiaapi", 169 "password": "your-loopia-api-account-password", 170 "debug": "true", // Set to true for extra debug output. Remove or set to false to prevent extra debug output. 171 "rate_limit_per": "Minute" 172 } 173 } 174 ``` 175 {% endcode %} 176 177 ## Usage 178 179 Here's an example DNS Configuration `dnsconfig.js` using the provider module. 180 Even though it shows how you use Loopia as Domain Registrar AND DNS Provider, 181 you're not forced to do that (thank god). 182 183 184 {% code title="dnsconfig.js" %} 185 ```javascript 186 var REG_LOOPIA = NewRegistrar("loopia"); 187 var DSP_LOOPIA = NewDnsProvider("loopia"); 188 189 // Set Default TTL for all RR to reflect our Backend API Default 190 // If you use additional DNS Providers, configure a default TTL 191 // per domain using the domain modifier DefaultTTL instead. 192 DEFAULTS( 193 NAMESERVER_TTL(3600), 194 DefaultTTL(3600) 195 ); 196 197 D("example.com", REG_LOOPIA, DnsProvider(DSP_LOOPIA), 198 //NAMESERVER("ns1.loopia.se."), //default 199 //NAMESERVER("ns2.loopia.se."), //default 200 A("elk1", "192.0.2.1"), 201 A("test", "192.0.2.2"), 202 END); 203 ``` 204 {% endcode %} 205 206 ## Special notes about newer standards 207 208 Loopia does not yet support [RFC7505](https://www.rfc-editor.org/rfc/rfc7505), so null `MX` records are 209 currently prohibited. 210 211 Until such a time when they do begin to support this, Loopias 212 `auditrecords.go` code prohibits this. 213 214 ## Metadata 215 216 This provider does not recognize any special metadata fields unique to LOOPIA. 217 218 ## get-zones 219 220 `dnscontrol get-zones` is implemented for this provider. 221 222 223 ## New domains 224 225 If a dnszone does not exist in your LOOPIA account, DNSControl will *not* automatically add it with the `dnscontrol push` or `dnscontrol preview` command. You'll need to do that via the control panel manually or using the command `dnscontrol create-domains`. 226 This is because it could lead to unwanted costs on customer-side that you may want to avoid. 227 228 ## Debug Mode 229 230 As shown in the configuration examples above, this can be activated on demand and it can be used to check the API commands sent to Loopia.