Quickstart

Get your first domain connected in under 5 minutes.

Before you begin

You'll need a DNS.GLOBAL account, your API key pair (public key + secret key), and a test domain pointed at a supported DNS provider.

Prerequisites

  • A DNS.GLOBAL account (sign up at dns.global)
  • Your API key pair (public key pk_... + secret key sk_...)
  • A test domain pointed at a supported DNS provider

Step 1: Set your DNS template

Define the records DNS.GLOBAL should deploy for your users. Templates are versioned, so you can update them without breaking existing connections.

curl -X PUT https://api.dns.global/v1/templates \
-H "Authorization: Bearer sk_live_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
  "records": [
    { "type": "CNAME", "host": "@", "value": "edge.dns.global" },
    { "type": "TXT", "host": "_dns-verify", "value": "{{verification_token}}" }
  ]
}'

Step 2: Create a session token

Your backend mints a short-lived session for the client. This call must be made server-to-server with your secret key — never expose it to the browser.

curl -X POST https://api.dns.global/v1/sessions \
-H "Authorization: Bearer sk_live_your_secret_key" \
-H "Content-Type: application/json" \
-d '{ "user_id": "user_456", "domain": "shop.example.com", "nonce": "a1b2c3" }'
# → { "session_token": "sess_abc123...", "expires_at": "2026-06-01T13:00:00Z" }

Step 3: Embed the widget (web)

Add the script tag and initialize the widget with the session token. The public key is safe to expose in client code.

<script src="https://dns.global/widget.js"></script>
<script>
  DnsGlobal.init({
    sessionToken: "sess_abc123...",
    publicKey: "pk_live_...",
    onSuccess: (result) => console.log("Connected!", result),
  });
</script>

Step 4: Test the flow

Click Connect Domain, enter your test domain, authorize with the detected provider, confirm the change plan, and watch the records deploy and verify.

Tip

Use a domain you control on Cloudflare or Route 53 for the smoothest first run — both support full automation with fast propagation.

What's next?

Was this page helpful?