github.com/StackExchange/dnscontrol/v4@v4.11.0/documentation/provider/ovh.md (about)

     1  ## Configuration
     2  
     3  To use this provider, add an entry to `creds.json` with `TYPE` set to `OVH`
     4  along with a OVH app-key, app-secret-key, consumer-key and optionally endpoint.
     5  
     6  Example:
     7  
     8  {% code title="creds.json" %}
     9  ```json
    10  {
    11    "ovh": {
    12      "TYPE": "OVH",
    13      "app-key": "your app key",
    14      "app-secret-key": "your app secret key",
    15      "consumer-key": "your consumer key",
    16      "endpoint": "eu"
    17    }
    18  }
    19  ```
    20  {% endcode %}
    21  
    22  See [the Activation section](#activation) for details on obtaining these credentials.
    23  
    24  `endpoint` can take the following values:
    25  
    26  * `eu` (the default), for connecting to the OVH European endpoint
    27  * `ca` for connecting to OVH Canada API endpoint
    28  * `us` for connecting to the OVH USA API endpoint
    29  * an url for connecting to a different endpoint than the ones above
    30  
    31  ## Metadata
    32  
    33  This provider does not recognize any special metadata fields unique to OVH.
    34  
    35  ## Usage
    36  
    37  An example configuration: (DNS hosted with OVH):
    38  
    39  {% code title="dnsconfig.js" %}
    40  ```javascript
    41  var REG_OVH = NewRegistrar("ovh");
    42  var DSP_OVH = NewDnsProvider("ovh");
    43  
    44  D("example.com", REG_OVH, DnsProvider(DSP_OVH),
    45      A("test", "1.2.3.4"),
    46  END);
    47  ```
    48  {% endcode %}
    49  
    50  An example configuration: (Registrar only. DNS hosted elsewhere)
    51  
    52  {% code title="dnsconfig.js" %}
    53  ```javascript
    54  var REG_OVH = NewRegistrar("ovh");
    55  var DSP_R53 = NewDnsProvider("r53");
    56  
    57  D("example.com", REG_OVH, DnsProvider(DSP_R53),
    58      A("test", "1.2.3.4"),
    59  END);
    60  ```
    61  {% endcode %}
    62  
    63  ## Activation
    64  
    65  To obtain the OVH keys, one need to register an app at OVH by following the
    66  [OVH API Getting Started](https://help.ovhcloud.com/csm/en-gb-api-getting-started-ovhcloud-api?id=kb_article_view&sysparm_article=KB0042784)
    67  
    68  It consist in declaring the app at <https://eu.api.ovh.com/createApp/>
    69  which gives the `app-key` and `app-secret-key`. If your domains and zones are located in another region, see below for the correct url to use.
    70  
    71  Once done, to obtain the `consumer-key` it is necessary to authorize the just created app
    72  to access the data in a specific account:
    73  
    74  ```shell
    75  curl -XPOST -H"X-Ovh-Application: <you-app-key>" -H "Content-type: application/json" https://eu.api.ovh.com/1.0/auth/credential -d'{
    76    "accessRules": [
    77      {
    78        "method": "DELETE",
    79        "path": "/domain/zone/*"
    80      },
    81      {
    82        "method": "GET",
    83        "path": "/domain/zone/*"
    84      },
    85      {
    86        "method": "POST",
    87        "path": "/domain/zone/*"
    88      },
    89      {
    90        "method": "PUT",
    91        "path": "/domain/zone/*"
    92      },
    93      {
    94        "method": "GET",
    95        "path": "/domain/*"
    96      },
    97      {
    98        "method": "PUT",
    99        "path": "/domain/*"
   100      },
   101      {
   102        "method": "POST",
   103        "path": "/domain/*/nameServers/update"
   104      }
   105    ]
   106  }'
   107  ```
   108  
   109  It should return something akin to:
   110  
   111  ```json
   112  {
   113    "validationUrl": "https://eu.api.ovh.com/auth/?credentialToken=<long-token>",
   114    "consumerKey": "<your-consumer-key>",
   115    "state": "pendingValidation"
   116  }
   117  ```
   118  
   119  Open the "validationUrl" in a browser and log in with your OVH account. This will link the app with your account,
   120  authorizing it to access your zones and domains.
   121  
   122  Do not forget to fill the `consumer-key` of your `creds.json`.
   123  
   124  For accessing the other international endpoints such as US and CA, change the `https://eu.api.ovh.com` used above to one of the following:
   125  
   126  * Canada endpoint: `https://ca.api.ovh.com`
   127  * US endpoint: `https://api.us.ovhcloud.com`
   128  
   129  Do not forget to fill the `endpoint` of your `creds.json` if you use an endpoint different than the EU one.
   130  
   131  ## New domains
   132  
   133  If a domain does not exist in your OVH account, DNSControl
   134  will *not* automatically add it. You'll need to do that via the
   135  control panel manually.
   136  
   137  ## Dual providers scenario
   138  
   139  OVH now allows to host DNS zone for a domain that is not registered in their registrar (see: <https://www.ovh.com/manager/web/#/zone>). The following dual providers scenario are supported:
   140  
   141  | registrar | zone        | working? |
   142  |:---------:|:-----------:|:--------:|
   143  |  OVH      | other       |    ✅     |
   144  |  OVH      | OVH + other |    ✅     |
   145  |  other    | OVH         |    ✅     |
   146  
   147  ## Caveats
   148  
   149  * OVH doesn't allow resetting the zone to the OVH DNS through the API. If for any reasons OVH NS entries were
   150  removed the only way to add them back is by using the OVH Control Panel (in the DNS Servers tab, click on the "Reset the
   151  DNS servers" button.
   152  * There may be a slight delay (1-10 minutes) before your modifications appear in the OVH Control Panel. However it seems that it's only cosmetic - the changes are indeed available at the DNS servers. You can confirm that the changes are taken into account by OVH by choosing "Change in text format", and see in the BIND compatible format that your changes are indeed there. And you can confirm by directly asking the DNS servers (e.g. with `dig`).
   153  * OVH enforces the [Restrictions on valid hostnames](https://en.wikipedia.org/wiki/Hostname#Syntax). A hostname with an underscore ("_") will cause the following error `FAILURE! OVHcloud API error (status code 400): Client::BadRequest: "Invalid domain name, underscore not allowed"`