api.domains

add()

api.domains.add(name) → Promise<Domain>

附加域名并将其交给登记员。 区域开始空空, 没有任何文字 。

writes nothingone account per namenameservers come back
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const domain = await api.domains.add("example.com");

domain.status;        // "pending_nameservers"
domain.nameservers;   // the pair to set at the registrar
domain = api.domains.add("example.com")

domain.status        # "pending_nameservers"
domain.nameservers   # the pair to set at the registrar

区域开始空空, 这就是陷阱

暂时不要告诉客户切换

在别处购买的域名已经服务于网站和邮箱。 指定空区登记员, 此时停止所有域名。 首先读取迁移( ) , 如果它这么说, 则导入( ) 。

搜索域域今天服务的内容, 搜索附加在附加上, 并查找它找到的种子 (移徙) 和 ( 导入)。无任何东西出现在该区。

整个序列

const domain = await api.domains.add("example.com");

const plan = await domain.migration();
if (!plan.safeToSwitch) {
  const { added, skipped } = await domain.records.import();
  console.log(added, "copied,", skipped.length, "to do by hand");
}

// Now the registrar can be pointed at domain.nameservers
await domain.check();
domain = api.domains.add("example.com")

plan = domain.migration()
if not plan["safeToSwitch"]:
    result = domain.records.import_zone()
    print(result.get("added"), "copied,", len(result.get("skipped") or []), "to do by hand")

# Now the registrar can be pointed at domain.nameservers
domain.check()

名字属于一个账户

domain_taken 第二次尝试:第二个账户将覆盖第一个区域。

读取命名者, 不要硬码他们

它们被存储在每个域域, 并返回到对象上。 将一对书写入自己的代码是有效的, 直到它不起作用的一天。