如何为另一台主机设置子域?

发布于 2024-09-19 12:37:19 字数 489 浏览 8 评论 0原文

大家好,我最近购买了一个便宜的 vps 来玩,以习惯使用 Linux、命令行和服务器。

我还有一个共享虚拟主机,用于托管我的网站。

现在,我想将我的网站保留在我的共享虚拟主机上,直到我完全了解如何使用我的 vps,然后我将慢慢开始移动项目,等等。

所以我已经将我的域(即domain.com)连接到我的共享主机。但我想为我的 vps 分配一个子域,这可能吗?喜欢 vps.domain.com 吗?

例如,我正在设置 webmin,我可以设置我的域吗,当我转到 vps.domain.com:10000 时,它实际上会转到该网站(我不是指重定向),就好像我要去它的IP http://00.000.000.000:1000

我该怎么做?我从 namecheap 购买了域名,我的共享虚拟主机正在使用 cpanel,如果你们需要,我可以提供更多信息。

Hey guys, so I recently purchased a cheap vps for me to play around with, to get used to working with linux, command line, and servers.

I also have a shared webhost that I host my site on.

For now, I want to keep my site on my shared webhost until I fully find out how to work with my vps, then I'll slowly start moving projects, ect over.

So I have my domain, (I.E domain.com) connected or whatever to my shared host. But I want to like, assign a subdomain to my vps, is this possible? Like vps.domain.com?

For example, I was setting up webmin, can I set up my domain for when I go to vps.domain.com:10000, it actually goes to the site, (and I don't mean redirection), as if I were going to it's ip http://00.000.000.000:1000?

How can I do this? I bought my domain from namecheap, and my shared webhost is using cpanel, I can provide more information if you guys need.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

め可乐爱微笑 2024-09-26 12:37:19

您只需为 vps.example.com 创建一条 A 资源记录。通常,您可以在注册 example.com 的提供商的配置面板中执行此操作。

You just need to create an A resource record for vps.example.com. Usually you can do that in the configuration panel of the provider you've registered example.com with.

就像说晚安 2024-09-26 12:37:19

当我想将子域重定向到其他地方时,我在 DNS 的区域文件中创建一条“A 记录”。

“A 记录”最常用于将主机名映射到主机的 IP 地址。

在您的情况下,“A 记录”将类似于“vpn”=> 255.255.255.255

When i want to redirect a subdomain to somewhere else, i'm creating a "A record" in the zone file of the DNS.

"A record" are most commonly used to map hostnames to an IP address of the host.

In your case the "A record" will be something like "vpn" => 255.255.255.255

森林迷了鹿 2024-09-26 12:37:19

由于您可以在 DNS 设置中创建子域,因此没有问题,像 freedns.ws 这样的工具对此很有帮助。

只需登录,创建一个子域并将VPS的DNS记录分配给该子域,您还可能需要在主域名记录中添加新记录,因为默认情况下您有*.domainname.com,这意味着所有子域,您可以添加新的子域并将其指向 VPS。

我想应该可以做到

Since you can create subdomain in DNS settings there is no problem, tools like freedns.ws are kind of good for this.

Just Login, create a subdomain and have the DNS records of the VPS assigned to the subdomain, also you may need to add a new record to the main domain name record, cause by deafult you have *.domainname.com which means all subdomain, you can add the new subdomain and have it point to the VPS.

I guess that should do it

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文