Skip to main content

Bulk host domains using the didnames CLI

DID Names offers a didnames CLI tool to simplify managing domains hosted with other providers within the DID Names system.

This document details how to use this tool.

Installation

javascript
npm install -g @blocklet/didnames

Or run directly via npx, no installation required.

javascript
npx @blocklet/didnames --version

Commands

javascript
Usage: didname [options] [command]

DID Names CLI tool

Options:
  -V, --version                 output the version number
  -h, --help                    display help for command

Commands:
  list-domains [options]        List all domains from provider
  update-nameservers [options]  Update nameservers for one or more domains
  help [command]                display help for command

List all DID Names (DID Domains)

javascript
didnames list-domains --provider <provider name> # Example: didnames list-domains --provider route53

Update Name Servers

javascript
didnames update-nameservers \
  --provider <provider> \
  --domains <domain1> <domain2> <domain3> \
  --nameservers \
    <nameserver1> \
    <nameserver2> \
    <nameserver3>

Supported Domain Name Registrars

AWS Route 53

Step 1: Set up AWS credentials

Before running the command, configure the Access Key ID and Secret Access Key as follows:

  • Log in to the AWS Management Console and go to IAM.
  • Create or use an existing user and assign the necessary permissions.
  • Generate an Access Key ID and Secret Access Key.

Set environment variables in your terminal (recommended).

javascript
export AWS_ACCESS_KEY_ID="你的AccessKeyId"
export AWS_SECRET_ACCESS_KEY="你的SecretAccessKey"

Step 2: Necessary Permissions

  • List domains (AWS Route 53: ListDomains)
  • Change nameservers: `route53domains

Policy (JSON)

javascript
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "route53domains:ListDomains",
        "route53domains:UpdateDomainNameservers"
      ],
      "Resource": "*"
    }
  ]
}

Security Advisory

  • Do not embed AWS credentials directly into scripts or codebases.
  • After using it, run the following command to clear the variables:
javascript
unset AWS_ACCESS_KEY_ID
unset AWS_SECRET_ACCESS_KEY