在域名接入前后访问网站的方式

新注册的域名,或刚更新了 nameserver 的域名,最多可能需要 24 小时才能在全球范围内生效。这是 解析传播(propagation)过程中的正常现象;在域名完全激活并指向 Hostinger之前,网站、邮箱、FTP 等大多数功能将无法使用。

在此期间,你可能会收到「你的域名正在连接中」的提示。不过,你可以立刻开始搭建或迁移网站,并实时查看改动效果——使用下面任意一种方法即可。

使用预览域名(preview domain)

Hostinger Websites menu with the three-dot menu open and Website Details highlighted
Hostinger Websites menu with the three-dot menu open and Website Details highlighted
Hostinger website details page with the temporary preview domain highlighted
Hostinger website details page with the temporary preview domain highlighted
Hostinger website details with the three-dot menu open and Remove preview domain highlighted
Hostinger website details with the three-dot menu open and Remove preview domain highlighted

如果你的域名尚未指向 Hostinger 的 nameserver,可以使用预览域名。查看预览域名的方法:进入 网站 Websites,点击你想预览的域名旁边的省略号(⋯),然后点击 网站详情(Website Details)

在那里你就能找到可用的预览域名!

如果你想移除预览域名,可以点击省略号,然后选择 移除预览域名(Remove preview domain)

使用临时域名(temporary domain)

Hostinger setup screen with the Use temporary domain option highlighted next to the Next button
Hostinger setup screen with the Use temporary domain option highlighted next to the Next button
Hostinger WordPress dashboard with the Preview button highlighted
Hostinger WordPress dashboard with the Preview button highlighted

添加网站到你的主机套餐时,你可以选择使用自己已有的自定义域名或子域名,也可以使用系统随机生成的临时域名。

只要你的主机套餐处于有效状态,临时域名就能一直使用;之后你随时可以将网站连接到自定义域名。

临时域名的网址是固定的,无法更改。

如果你已经用自定义域名添加了网站,可以通过 网站 Websites仪表盘(Dashboard),点击 预览(Preview) 来访问临时域名:

修改 hosts 文件

Hostinger website details showing the website IP address highlighted
Hostinger website details showing the website IP address highlighted

另一种方式是修改设备的 hosts 文件,添加以下两行:

185.185.185.185 www.domain.tld
185.185.185.185 domain.tld

请将 185.185.185.185 替换为你主机账户的 IP 地址,将 domain.tld 替换为你的域名。

要查找主机套餐的 IP 地址,进入 网站 Websites 分区,点击站点旁的 仪表盘(Dashboard),进入 套餐详情 Plan Details。IP 会显示在 网站详情(Website Details) 区域:

不再需要时,请记得还原对 hosts 文件所做的修改。

使用临时 URL

Hostinger preview website form with regular website option selected and domain.tld field shown
Hostinger preview website form with regular website option selected and domain.tld field shown

你可以使用 SkipDNS 工具生成一个预览 URL。

在该工具中按以下信息填写,即可预览你的网站内容:

  1. Preview(预览):选择常规网站(regular website)。
  2. Hosted on(托管于):填入主机套餐的 IP 地址
  3. Under(域名):填入你网站的域名或 URL。
  4. Over(端口):选择常规端口(regular ports)。

然后点击 Go(前往)

来源:Hostinger 官方帮助文档