我可以使用相同的域名在多个主机上设置网站吗? [英] Can I set up websites on multiple hosts using the same domain name?

查看:30
本文介绍了我可以使用相同的域名在多个主机上设置网站吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解如何为以下场景设置以下域、网站和 IP 地址:

I would like to understand how to set up the following domains, websites and IP addresses for the following scenario:

用户输入 www.mysite.com,这将解析为 www.mysite.com,我可以毫无问题地托管 A

User types www.mysite.com and this resolves to www.mysite.com which I can do without any problems to host A

在主机 A 上的站点上,用户然后单击一个指向 stores.mysite.com 的链接,这将解析到主机 B 上的 stores.mysite.com,并且此 URL 下的所有页面也应指向此链接.

On the site on host A, a user then clicks a link to retailers.mysite.com and this resolves to retailers.mysite.com on host B and all pages under this URL should point to this too.

我将如何进行设置?它甚至可行吗?

How would I go about setting this up? Is it even doable?

我想这样做的原因是我想用一个主机(上例中的主机 A)和另一个主机(上例中的主机 B)托管一个核心网站,但我希望它看起来像一个网站 (mysite.com)

The reason I want to do this is that I want to host a blog with one host (host A in the example above) and the core website with another host (host B in the example above) but I want it to look like one website (mysite.com)

推荐答案

是的,这可以通过域的 dns 设置轻松实现.

Yes this is easily accomplished via the dns settings for your domain.

您需要知道不同主机的 IP 地址或域名.然后,您可以为子域设置 CNAME 记录并将其指向相应的目标主机

You need to know the IPAddress or domain name for the different hosts. You can then setup a CNAME record for the subdomain and point it to the coresponding target host

*.mysite.com -> A Record -> 主机 A

*.mysite.com -> A Record -> host A

retailers.mysite.com -> CNAME -> 主机 B

retailers.mysite.com -> CNAME -> host B

这篇关于我可以使用相同的域名在多个主机上设置网站吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆