DNS API

Skip to main content
Du bist hier:
Drucken

DNS API

DNS API

This guide explains how to use our DNS API.

 

Step 1: Enable API Access

Before you can use the DNS API, go to admin.firestorm.ch and log in with your FireStorm ID. Enable the DNS API under Account => Customer Profile => API Access.

Step 2: Copy API Key

After activation, your personal API key will be displayed. Copy this key and use it for all API requests.

Step 3: Use the API

Use the API key in the X-API-Key header:

curl -H "X-API-Key: YOUR_API_KEY" https://api.firestorm.ch/dns/v1/zones

 

Additional Scoped API Keys (Subaccounts)

In addition to your main API key, you can create any number of additional API keys in the client area, each valid only for the domains you select. This is especially useful if you are an IT service provider or agency managing DNS zones for several customers and want to give each customer access to only their own domain, for example for automatic certificate renewal via DNS-01.

You create and manage these additional keys under Account => Update Account Details via the Manage API Keys button next to the API key field. For more details see: Scoped API Keys.

 

API Endpoints

Zones

Method Endpoint Description
GET /dns/v1/zones List all zones

 

Single Records

Method Endpoint Description
GET /dns/v1/zone/{id}/records List all records of a zone
POST /dns/v1/zone/{id}/record Add single record
PUT /dns/v1/zone/{id}/record Update single record
DELETE /dns/v1/zone/{id}/record Delete single record

 

Examples

Get Zone ID

curl -H "X-API-Key: YOUR_API_KEY" https://api.firestorm.ch/dns/v1/zones

Response:

{
    "status": "OK",
    "zones": [
        {"id": 123, "name": "example.ch"},
        {"id": 456, "name": "example.com"}
    ]
}

List Records

curl -H "X-API-Key: YOUR_API_KEY" https://api.firestorm.ch/dns/v1/zone/123/records

Add Record

curl -X POST -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" 
  -d '{"name":"test.example.ch.","type":"A","data":"192.168.1.1","ttl":3600}' 
  https://api.firestorm.ch/dns/v1/zone/123/record

Update Record

curl -X PUT -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" 
  -d '{"name":"test.example.ch.","type":"A","old_data":"192.168.1.1","data":"192.168.1.2","ttl":3600}' 
  https://api.firestorm.ch/dns/v1/zone/123/record

Delete Record

curl -X DELETE -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" 
  -d '{"name":"test.example.ch.","type":"A","data":"192.168.1.2"}' 
  https://api.firestorm.ch/dns/v1/zone/123/record

 

Allowed Record Types

A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, PTR

Validation

  • A: Must be a valid IPv4 address
  • AAAA: Must be a valid IPv6 address
  • CNAME: Must be a FQDN ending with a dot (e.g. example.ch.)
  • TXT: Automatically wrapped in quotes
  • TTL: Minimum 60, maximum 86400, default 3600

 

ACME DNS-01 Challenge

Automatic Propagation: For _acme-challenge.* records, the API automatically waits until all DNS servers have the record. The response contains propagation details:

{
    "status": "OK",
    "record_id": 12345,
    "propagation": {
        "propagated": true,
        "time": 45,
        "servers": {
            "dns11.firestorm.ch": true,
            "dns12.firestorm-isp.com": true,
            "dns13.firestorm-isp.com": true,
            "dns14.firestorm.ch": true
        }
    }
}

 

More Examples

For PowerShell examples see: DNS API PowerShell Example

For MikroTik routers see the article DynDNS with a MikroTik router, for Cert Warden the article Let’s Encrypt with Cert Warden.

Related Post