LinuxCommandLibrary

linode-cli-domains

Manage domain records on Linode

TLDR

List all managed domains

$ linode-cli domains list
copy

Create a new managed domain
$ linode-cli domains create --domain [domain_name] --type [master|slave] --soa-email [email]
copy

View details of a specific domain
$ linode-cli domains view [domain_id]
copy

Delete a managed domain
$ linode-cli domains delete [domain_id]
copy

List records for a specific domain
$ linode-cli domains records-list [domain_id]
copy

Add a DNS record to a domain
$ linode-cli domains records-create [domain_id] --type [A|AAAA|CNAME|MX|...] --name [subdomain] --target [target_value]
copy

Update a DNS record for a domain
$ linode-cli domains records-update [domain_id] [record_id] --target [new_target_value]
copy

Delete a DNS record from a domain
$ linode-cli domains records-delete [domain_id] [record_id]
copy

SYNOPSIS

linode-cli domains <subcommand> [options] [arguments]

PARAMETERS

<subcommand>
    Specifies the action to perform on domains or records, e.g., list, create, view, update, delete, record-list, record-create, etc.

--help
    Displays help information for the domains command group or a specific subcommand.

--text
    Formats command output in a plain text table.

--json
    Formats command output as raw JSON.

--pretty
    Applies pretty-printing to JSON output for readability.

--domain TEXT
    Specifies the domain name to operate on, typically used for identifying a domain for view, update, or delete operations.

--type [master|slave]
    Defines the domain's operational type (e.g., 'master' for a primary DNS server, 'slave' for a secondary server). Used with create.

--description TEXT
    Provides an optional descriptive label for the domain.

--group TEXT
    Assigns the domain to a specified group for organizational purposes.

--tags TEXT
    Attaches a comma-separated list of tags to the domain for filtering and organization.

--ttl_sec INT
    Sets the default Time To Live (TTL) in seconds for new DNS records within the domain.

DESCRIPTION

The linode-cli domains command group provides a comprehensive interface for programmatically managing DNS domains and their associated records within the Linode platform.

Users can perform a variety of operations including creating new domains, listing existing domains, viewing detailed information for a specific domain, and updating or deleting domains. Beyond domain-level management, it offers extensive functionality for handling individual DNS records (such as A, AAAA, MX, NS, CNAME, TXT, SRV, LBRECORD types) within any given domain. This command is essential for automating DNS management tasks, integrating Linode DNS services into scripts, or managing configurations without relying on the Linode Cloud Manager UI.

CAVEATS

Using linode-cli domains requires a properly configured Linode API Token with sufficient permissions (read/write access to Domains). Users must also ensure network connectivity to the Linode API. Be mindful of Linode API rate limits when scripting extensive operations. Changes to DNS records may take time to propagate globally due to DNS caching.

SUBCOMMANDS OVERVIEW

The linode-cli domains command functions as a gateway to numerous specialized subcommands. Prominent examples include:
list: Retrieves a list of all DNS domains on the account.
create: Adds a new DNS domain.
view <domain_id>: Displays detailed information about a specific domain.
update <domain_id>: Modifies existing domain settings.
delete <domain_id>: Removes a domain permanently.
Additionally, a complete suite of record- commands (e.g., record-list, record-create, record-update, record-delete) exists for granular management of individual DNS entries within a domain.

API TOKEN CONFIGURATION

Before any linode-cli command can be executed, a Linode API token must be configured. This is typically done using the command linode-cli configure. The configured token authenticates all subsequent requests to the Linode API and dictates the level of access and permissions the CLI has to your Linode resources, including DNS domains.

HISTORY

The linode-cli tool has evolved as Linode's API and services expanded. The domains subcommand group has been a fundamental component of its functionality since early versions, providing direct programmatic access to Linode's robust DNS manager. It reflects Linode's commitment to offering comprehensive command-line interfaces for all its cloud services, enabling automation and integration into various DevOps workflows.

SEE ALSO

Copied to clipboard