Skip to main content

sng dns

Beta

Being rolled out. The interface described here is the one of the next release: it may still change, and may not be enabled on your tenant yet.

Being enabled gradually on tenants.

The sng dns group manages the domains you bring (sng dns zone, kind DNSZone) and the records of your zones (sng dns record, kind DNSRecord). Each command writes or reads the corresponding manifest in the desired state, then the platform applies it: allow a few minutes before a change becomes visible. Buying domains is handled by sng domain (not available).

All commands require a session on the tenant. Otherwise: tenant session required: run sng tenant use NAME. The global flags (--config, --json, -v, --version) are described in the CLI index.

IAM actions per command:

CommandIAM actionResourceRoute
zone listdns:listdnszone/*GET /v1/dns/zones
zone createdns:writednszone/* and dnszone/<domaine>POST /v1/dns/zones
zone describedns:readdnszone/<domaine>GET /v1/dns/zones/{domain}
zone deletedns:deletednszone/<domaine>DELETE /v1/dns/zones/{domain}
record listdns:listdnsrecord/*GET /v1/dns/records
record setdns:writednsrecord/<id>PUT /v1/dns/records
record describedns:readdnsrecord/<id>GET /v1/dns/records/{id}
record deletedns:deletednsrecord/<id>DELETE /v1/dns/records/{id}

The managed readonly policies cover list, describe; readwrite and admin cover everything. A refusal shows forbidden (no policy of this tenant allows it: see sng tenant policy list). sng apply of a DNSZone or a DNSRecord also requires dns:write in addition to deploy:write. If DNS is not enabled on the API: DNS non configuré sur cette API.

sng dns zone list​

sng dns zone list

Lists the domains you brought in the current tenant. The default zone <tenant>.dev.stackngo.app does not appear.

FlagTypeDefaultDescription
(no flags of its own)
sng dns zone list
DOMAIN PHASE READY REASON
exemple.fr Active yes Delegated
exemple.io - (sync…) no

(sync…): the platform has not seen the zone yet. Without zones: aucune zone.

--json output: {"zones": [ … ]}, each zone having the shape described under zone describe.

sng dns zone create​

sng dns zone create DOMAIN [--source SOURCE]

Alias: add. Declares a domain you bring. The DNSZone object is named after the domain (exemple.fr).

ArgumentDescription
DOMAINregistrable domain (exemple.fr), converted to lowercase, trailing dot removed
FlagTypeDefaultDescription
--sourcestring(API: Bring)origin of the domain; only Bring is accepted
sng dns zone create exemple.fr
zone exemple.fr déclarée
étape suivante : posez cet enregistrement chez l'hébergeur DNS actuel du domaine :
_stackngo-verify.exemple.fr TXT "sng-verify-4b1f0e9c2a7d4e6b8c3f1a2d5e7b9c0f"
puis suivez la vérification : sng dns zone describe <domaine>

The TXT is computed right after creation: create waits for it for up to 20 seconds before printing it. If it is still not ready, the command ends with TXT de vérification pas encore calculé : sng dns zone describe exemple.fr; describe will show it a few moments later. --json returns the zone with its verification field as soon as it is known.

Errors (API HTTP code):

MessageCause
domaine "www.exemple.fr" : sous-domaine de exemple.fr, déclarer exemple.fr (400)subdomain
domaine "exemple.zz" : TLD inconnu (400)suffix missing from the public list
domaine "x.stackngo.app" : domaine de la plateforme (stackngo.app) (400)platform domain (stackngo.app, stackngo.fr and their subdomains), never bring-your-own
l'achat de domaine (source: Purchase) n'est pas encore disponible (400)--source Purchase
le DNSZone "exemple.fr" existe déjà (409)already declared in the tenant
domaine "exemple.fr" déjà déclaré (exemple) (409)declared under another name
invalid zone domain (400)characters outside a-z, 0-9, -, .

sng dns zone describe​

sng dns zone describe DOMAIN

Alias: show. State of a zone, and the next step: the TXT to add in the Pending phase, the name servers in the Provisioned or Active phase.

ArgumentDescription
DOMAINdomain of the zone
sng dns zone describe exemple.fr
domain: exemple.fr
source: Bring
phase: Provisioned
ready: no
reason: AwaitingDelegation
message: déclarer chez le registrar les serveurs de noms : dns200.anycast.me, ns200.anycast.me

serveurs de noms à déclarer chez le registrar du domaine :
dns200.anycast.me
ns200.anycast.me

synced: no (pas encore réconcilié) appears as long as the platform has not seen the zone.

--json output:

{
"id": "exemple.fr",
"domain": "exemple.fr",
"source": "Bring",
"phase": "Provisioned",
"verification": { "name": "_stackngo-verify.exemple.fr", "value": "sng-verify-4b1f0e9c2a7d4e6b8c3f1a2d5e7b9c0f" },
"name_servers": ["dns200.anycast.me", "ns200.anycast.me"],
"ready": false,
"synced": true,
"reason": "AwaitingDelegation",
"message": "déclarer chez le registrar les serveurs de noms : dns200.anycast.me, ns200.anycast.me"
}

Errors: zone "exemple.fr" (404) if the domain is not declared in the tenant.

sng dns zone delete​

sng dns zone delete DOMAIN [--yes]

Alias: rm. Removes a domain you brought. Asks for confirmation (oui, yes, o, or y).

ArgumentDescription
DOMAINdomain of the zone
FlagTypeDefaultDescription
--yes, -yboolfalseconfirm without an interactive prompt
sng dns zone delete exemple.fr --yes
zone exemple.fr supprimée

--json output: {"domain": "exemple.fr", "deleted": true}.

Errors:

MessageCause
2 enregistrement(s) utilisent encore la zone "exemple.fr", les supprimer d'abord (409)DNSRecords of the tenant target the zone
confirmation requise : relancez avec --yes ou depuis un terminal interactifno terminal and no --yes
opération annuléeanswer other than oui
zone "exemple.fr" (404)domain not declared in the tenant

sng dns record list​

sng dns record list [--zone DOMAIN]

Lists the records of the current tenant, sorted by zone, name, and type.

FlagTypeDefaultDescription
--zonestringkeep only one zone (a domain you bring, or your default zone)
sng dns record list
ID FQDN TYPE TARGETS TTL READY REASON
api-preview-cname-5e1d0c3a api.preview.acme.dev.stackngo.app CNAME my-api.netlify.app 300 yes Published
www-a-7c2e91d4 www.acme.dev.stackngo.app A 203.0.113.10,203.0.113.11 300 yes Published
apex-mx-91b0e2fa exemple.fr MX 10 mx1.mail.ovh.net,20 mx2.mail.ovh.net 3600 no (sync…)

A record whose brought zone is not declared yet is shown as zone non déclarée (reason ZoneNotOwned): it is kept and published on its own once the zone is proven.

Without records: aucun enregistrement. --json output: {"records": [ … ]}.

sng dns record set​

sng dns record set NAME --type TYPE --target VALUE [--target VALUE ...] [--ttl N] [--zone DOMAIN]

Creates or replaces a record. The same zone + name + type combination is updated in place: targets and TTL are replaced. An identical request changes nothing.

ArgumentDescription
NAMEname relative to the zone: @ (apex), www, a.b, *.preview, _dmarc
FlagTypeDefaultDescription
--typestring(required)A, AAAA, CNAME, TXT, or MX (case-insensitive)
--targetstring, repeatable(required)target: IP, hostname, text, or "<priorité> <hôte>" for an MX
--ttlint300TTL in seconds, from 60 to 86,400
--zonestring(default zone)domain you bring; may be declared afterwards (the record stays ZoneNotOwned then is published on its own) (your default zone, given explicitly, is equivalent to omitting the flag)
sng dns record set www --type A --target 203.0.113.10 --target 203.0.113.11
sng dns record set @ --type MX --target "10 mx.exemple.fr" --zone exemple.fr --ttl 3600
sng dns record set _dmarc --zone exemple.fr --type TXT --target "v=DMARC1; p=none"
enregistrement www.acme.dev.stackngo.app A créé : 203.0.113.10, 203.0.113.11 (id www-a-7c2e91d4)
effectif après … (quelques minutes) : sng dns record describe www-a-7c2e91d4

créé becomes mis à jour on an existing record. The id is derived from the zone, the name, and the type (@ → apex, * → wildcard, . → -, _ removed, plus a fingerprint).

--json output: the record, in the shape described under record describe.

Errors:

MessageCause
--type "SRV" : A, AAAA, CNAME, TXT, MXunsupported type (local check)
--ttl 30 : de 60 à 86400 secondesTTL out of bounds (local check)
au moins une cible : --targetempty targets
targets[0] : 10.0.0.12 n'est pas une adresse publique (400)private or reserved address
un CNAME a une seule cible et n'est jamais à l'apex (400)multiple CNAME or on @
nom "a..b" : relatif à la zone (@, www, a.b, *.preview, _dmarc), minuscules (400)invalid name
_acme-challenge.www.acme.dev.stackngo.app : label "_acme-challenge" réservé à la plateforme (400)reserved name
zone "exemple.fr" : aucun DNSZone du tenant ne la déclare (créer d'abord la zone) (400)domain not brought
enregistrement www A déjà déclaré (www, exemple) (409)same name and type declared in another object
enregistrement "…" modifié entre-temps, réessayez (409)concurrent modification

sng dns record describe​

sng dns record describe ID

Alias: show. State of a record. ID is returned by list and set; for a record applied with sng apply, it is the manifest name.

ArgumentDescription
IDrecord identifier
sng dns record describe www-a-7c2e91d4
id: www-a-7c2e91d4
fqdn: www.acme.dev.stackngo.app
zone: acme.dev.stackngo.app (zone par défaut)
name: www
type: A
ttl: 300
targets: 203.0.113.10, 203.0.113.11
ready: yes
reason: Published

--json output:

{
"id": "www-a-7c2e91d4",
"zone": "acme.dev.stackngo.app",
"default_zone": true,
"name": "www",
"type": "A",
"ttl": 300,
"targets": ["203.0.113.10", "203.0.113.11"],
"fqdn": "www.acme.dev.stackngo.app",
"ready": true,
"synced": true,
"reason": "Published"
}

Possible reasons: see DNSRecord — Status and conditions. Errors: enregistrement "x" (404); id d'enregistrement invalide "a/b" : voir sng dns record list.

sng dns record delete​

sng dns record delete ID [--yes]

Alias: rm. Deletes a record; it is removed from the DNS within a few minutes.

ArgumentDescription
IDrecord identifier
FlagTypeDefaultDescription
--yes, -yboolfalseconfirm without an interactive prompt
sng dns record delete www-a-7c2e91d4 --yes
enregistrement www-a-7c2e91d4 supprimé

--json output: {"id": "www-a-7c2e91d4", "deleted": true}. Errors: as for zone delete for the confirmation; enregistrement "x" (404).

See also​