/dns/distribution/connect
0.2.28Unchanged since publicationConnect this server to a DNS distribution network
dnsallGenerate a key for this server's licensed IPv4 address in the Clients tab of the DNS zones section on any node. If this server has no licensed IPv4 address on record, run urbestack-license-check first. The key lists each node's IPv4 address, port, and hostname. It starts with usk_ followed by 20 to 2048 ASCII letters, digits, underscores, or hyphens. Surrounding whitespace is allowed.
A malformed key returns 400. UrbeStack refuses keys that list this server as a node. An existing node must leave its network or stop the network if it is the only node before connecting as a client. UrbeStack contacts every node in the key and needs at least one to accept it. If every node is unreachable, the operation returns 502. If no node accepts the key and a node refuses it, the operation returns the node's 401, 402, or 403.
Set check to true to preview the connection without saving the key or sending zones. The first node to accept the key reports local zones whose names match, are subdomains of, or are parents of zones the network holds for another server. Overlaps are allowed. The preview returns 200 with connected set to false, nodes, and overlaps.
A connection saves the key and returns 202 with connected set to true and job for tracking the initial dns-push job. The job sends every local zone to each node, one request per zone and node. UrbeStack then sends changes as they occur. The timer retries unreachable nodes, nodes that refused the key, and failed deliveries. Replies from the network can identify nodes added later.
As commands
Run as root on the serverkeystringRequiredcheckbooleanExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/dns/distribution/connect" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"check": true,
"key": "panel.port"
}'200 OK{
"connected": true,
"nodes": [
{
"address": "info@example.com",
"host": "text",
"port": 8443
}
],
"overlaps": [
{
"name": "alice",
"relation": "same",
"server": "text",
"zone": "text"
}
]
}Errors
21 errors, each a status and a sentence400--key or --key-stdin is required400A new job is queued or running400Domain name required400Domain name too long400Invalid <what>: 400Invalid IPv4 address400Invalid IPv6 address400Invalid domain name400Invalid port400Invalid setting key400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Job parameters must be an object400This is not a key from an UrbeStack distribution network. A key starts with usk_ and comes from the Clients tab of one of the network's nodes400This is not a key from an UrbeStack distribution network. It does not carry the address, port and hostname of each node400This key names this server's own address, <me>, as a node of the network. Use it on the server it was generated for400Unknown job type400Username '<value>' is reserved401Authentication required402This server has no licensed address on record yet: run urbestack-license-check first404Setting '<key>' not found404User '<user>' not foundurbestack.com/docs/api/post-dns-distribution-connect/