connect-domain
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConnect a domain
连接域名
Get a domain serving a Hostinger website over HTTPS. The one rule that matters most: records that already work — email (), SPF, DKIM and verification records — must survive every DNS change.
MXTXT让域名通过 HTTPS 提供 Hostinger 网站服务。最重要的一条规则是:已经正常工作的记录——邮件()、SPF、DKIM 和验证 记录——必须在每次 DNS 更改后都保留下来。
MXTXTCalling the operations
调用操作
- Read the that
inputSchemareturns before the first call of each operation. If a name below is rejected as unknown,searchfor what the step does (e.g. "dns records").search - Batch reads with ; values pass between steps as
multi-execute. Batches chain operations from one server only — the Hostinger Connector runs$steps.<i>.<path>,hosting,agency-hostinganddomainsas separate servers. Whendnscannot find an operation, ask the user to enable that product group in the Connector.search - Every write here changes what the public sees. State the change and get a yes before each one.
- 在每种操作第一次调用前,读取 返回的
search。如果下面的某个名称被判定为未知名称,请通过inputSchema查找该步骤对应的功能(例如search)。dns records - 使用 批量读取;值通过
multi-execute在步骤之间传递。批次只能串联来自同一服务器的操作——Hostinger Connector 将$steps.<i>.<path>、hosting、agency-hosting和domains作为独立服务器运行。当dns无法找到某个操作时,请用户启用 Connector 中对应的产品组。search - 这里的每次写入都会改变公网可见的结果。每次写入前都要说明变更并获得用户确认。
1. Gather the facts (read-only)
1. 收集信息(只读)
- Website. with
hosting_websites_list(Shared and Cloud; substring match, so take the exact entry) anddomainwithagency-hosting_websites_list-plan(Agency). Keepdomainandusername, ororder_idanddetails.uid. When the domain has no website yet, find the site the user means — often adetails.ipv4one — or the order to create it on (*.hostingersite.com,hosting_orders_list).agency-hosting_orders_list - Registration. succeeds only for domains registered at Hostinger; its
domains_portfolio_getshow who runs DNS. Hostinger's own nameservers end inname_servers.dns-parking.com - Live DNS, to know what must be kept:
bash
dig +short NS DOMAIN; dig +short A DOMAIN; dig +short CNAME www.DOMAIN
dig +short MX DOMAIN; dig +short TXT DOMAIN; dig +short CAA DOMAIN- 网站。 使用 调用
domain(Shared 和 Cloud;支持子字符串匹配,因此要选择准确条目),并使用hosting_websites_list调用domain(Agency)。保留agency-hosting_websites_list-plan和username,或者order_id和details.uid。当域名还没有关联网站时,找出用户所指的网站——通常是details.ipv4网站——或用于创建网站的订单(*.hostingersite.com、hosting_orders_list)。agency-hosting_orders_list - 注册信息。 仅对在 Hostinger 注册的域名成功;其
domains_portfolio_get表明由谁管理 DNS。Hostinger 自有的 nameserver 以name_servers结尾。dns-parking.com - 实时 DNS,用于确定必须保留的内容:
bash
dig +short NS DOMAIN; dig +short A DOMAIN; dig +short CNAME www.DOMAIN
dig +short MX DOMAIN; dig +short TXT DOMAIN; dig +short CAA DOMAIN2. Attach the domain to hosting
2. 将域名绑定到虚拟主机
Shared and Cloud:
- New website on the domain. For a domain outside this account run first. When
hosting_domains_verify-ownershipis false, give the user theis_accessiblerecord it returns to add next to the existing ones, then verify again (propagation takes up to ~10 minutes). Create withTXT(hosting_websites_createwithoutdomain,www.), then pollorder_idwithhosting_websites_list-setupsevery 10–15 s untildomain.status: completed - Moving a site off its free subdomain. Shared and Cloud websites cannot be renamed through the API. Either create a website on the real domain and redeploy the project there (the skill) — required for WordPress, which keeps its URL in the database — or, for static sites, park the domain on the existing site with
deploy-to-hosting.hosting_domains_create-website-parked - Alias (a second domain showing the same site): .
hosting_domains_create-website-parked - Subdomain ():
shop.example.com.hosting_domains_create-website-subdomainbelongs to the main domain — do not create it as a subdomain.www
Agency Plan:
- adds a domain to the site.
agency-hosting_domains_link-to-website - replaces the primary domain, for example the free subdomain. The old name stops serving at once — confirm first.
agency-hosting_domains_change-website
Shared 和 Cloud:
- 在域名上创建新网站。 对于不属于此账户的域名,先运行 。当
hosting_domains_verify-ownership为 false 时,将它返回的is_accessible记录交给用户,让用户将其添加到现有记录旁边,然后再次验证(传播最多约需 10 分钟)。使用TXT创建网站(hosting_websites_create不带domain,并提供www.),然后每隔 10–15 秒使用order_id轮询domain,直到hosting_websites_list-setups。status: completed - 将网站从免费子域名迁移。 Shared 和 Cloud 网站无法通过 API 重命名。可以选择使用 skill 在真实域名上创建网站并重新部署项目——WordPress 必须采用此方式,因为它会在数据库中保存 URL;或者,对于静态站点,使用
deploy-to-hosting将域名停放到现有网站上。hosting_domains_create-website-parked - 别名(使用第二个域名显示同一个网站):。
hosting_domains_create-website-parked - 子域名():
shop.example.com。hosting_domains_create-website-subdomain属于主域名——不要将其创建为子域名。www
Agency 套餐:
- 将域名添加到网站。
agency-hosting_domains_link-to-website - 替换主域名,例如替换免费子域名。旧名称会立即停止提供服务——必须先确认。
agency-hosting_domains_change-website
3. Point DNS at Hostinger
3. 将 DNS 指向 Hostinger
DNS already at Hostinger (nameservers end in ): creating the website normally writes the records. Read the zone with ; when and already point at the site, change nothing. Before any edit, note the newest entry — rolls back to it.
dns-parking.comdns_records_list@wwwdns_snapshots_listdns_snapshots_restoredns_records_updateoverwrite: trueTXT@overwrite: falsetruedns_records_validateDNS elsewhere (registered at Hostinger with other nameservers, or registered elsewhere). Two options — let the user choose:
- Switch nameservers to Hostinger. Hostinger then manages every record. First copy each record the current DNS serves beyond the website — ,
MX, serviceTXTs — into the Hostinger zone withCNAME(dns_records_update); otherwise email breaks when the nameservers flip. Hostinger's nameserver pairs differ between domains (overwrite: false/ns1,ns2.dns-parking.com/solarand others), so use the pair hPanel shows for this domain, never a guessed one. For Hostinger-registered domains apply it withlunar.dns-parking.com; otherwise the user changes it at their registrar.domains_portfolio_update-nameservers - Keep the current DNS provider and change only the web records: for
Aand@(orCNAME) forA. Agency sites point atwww. Shared and Cloud sites point at the targets in the Hostinger zone for the domain (details.ipv4) or, when that zone does not exist, the IP hPanel shows for the website. The user makes this change at their DNS provider.dns_records_list
DNS 已在 Hostinger(nameserver 以 结尾):创建网站时通常会自动写入记录。使用 读取 DNS 区域;当 和 已经指向该网站时,不做任何更改。编辑前,记下最新的 条目—— 可回滚到该条目。
dns-parking.comdns_records_list@wwwdns_snapshots_listdns_snapshots_restoredns_records_updateoverwrite: true@TXToverwrite: falsetruedns_records_validateDNS 在其他位置(域名在 Hostinger 注册但使用其他 nameserver,或在其他服务商注册):有两种选择——让用户选择:
- 将 nameserver 切换到 Hostinger。 随后由 Hostinger 管理所有记录。首先将当前 DNS 提供的、除网站之外的所有记录——、
MX、服务TXT——使用CNAME(dns_records_update)复制到 Hostinger 区域;否则切换 nameserver 时邮件会中断。Hostinger 的 nameserver 配对因域名而异(overwrite: false/ns1、ns2.dns-parking.com/solar等),因此必须使用 hPanel 为该域名显示的配对,绝不能猜测。对于在 Hostinger 注册的域名,使用lunar.dns-parking.com应用更改;对于在其他服务商注册的域名,则由用户在其注册商处更改。domains_portfolio_update-nameservers - 保留当前 DNS 服务商,只更改网站记录:为 设置
@记录,为A设置www(或CNAME)记录。Agency 网站指向A。Shared 和 Cloud 网站指向 Hostinger 区域中该域名的目标(details.ipv4);如果该区域不存在,则指向 hPanel 为该网站显示的 IP。变更由用户在 DNS 服务商处完成。dns_records_list
4. SSL and HTTPS
4. SSL 和 HTTPS
Start only once shows the domain resolving to Hostinger — the certificate authority checks the domain against the server.
dig- Shared and Cloud: . When it is not
hosting_ssl_status, callactiveand poll the status untilhosting_ssl_install(oractivewithfailed), thenlast_errorwithhosting_ssl_toggle-https-redirect(it returns 422 until a certificate exists).is_enabled: true - Agency: for each domain, then poll
agency-hosting_ssl_install-website. A domain allows three setups per seven days and one request a minute — install once DNS is right and never loop.agency-hosting_ssl_website-status - A record at the apex that does not allow
CAAblocks issuance; the user addsletsencrypt.orgbeside the existing ones.0 issue "letsencrypt.org"
只有在 显示域名已解析到 Hostinger 后才能开始——证书颁发机构会检查域名是否指向该服务器。
dig- Shared 和 Cloud:使用 。当状态不是
hosting_ssl_status时,调用active并轮询状态,直到变为hosting_ssl_install(或者变为active并提供failed),然后调用last_error并设置hosting_ssl_toggle-https-redirect(在证书存在之前,该调用会返回 422)。is_enabled: true - Agency:对每个域名调用 ,然后轮询
agency-hosting_ssl_install-website。每个域名允许每 7 天设置 3 次,并且每分钟只能请求 1 次——DNS 配置正确后安装一次,切勿循环调用。agency-hosting_ssl_website-status - 根域名处的 记录如果不允许
CAA,就会阻止证书签发;用户需要在现有记录旁添加letsencrypt.org。0 issue "letsencrypt.org"
5. Verify
5. 验证
bash
dig +short A DOMAIN; dig +short A www.DOMAIN
curl -sSI https://DOMAIN/ | grep -i -E "^(HTTP|platform|location)"
curl -sSI http://DOMAIN/ | grep -i -E "^(HTTP|location)"
dig +short MX DOMAINDone when both names resolve to Hostinger, HTTPS answers with , HTTP redirects to HTTPS, and still matches step 1. Nameserver changes can take up to 24–48 hours to reach every resolver; when records are still old, report what is pending and the command to re-check instead of polling for hours.
platform: hostingerMXbash
dig +short A DOMAIN; dig +short A www.DOMAIN
curl -sSI https://DOMAIN/ | grep -i -E "^(HTTP|platform|location)"
curl -sSI http://DOMAIN/ | grep -i -E "^(HTTP|location)"
dig +short MX DOMAIN完成条件:两个名称都解析到 Hostinger,HTTPS 响应包含 ,HTTP 重定向到 HTTPS,且 仍与第 1 步一致。nameserver 更改可能需要 24–48 小时才能传播到所有解析器;当记录仍是旧值时,应报告仍在等待的内容和重新检查所用的命令,而不是持续轮询数小时。
platform: hostingerMX