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

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

问题描述

我想了解如何为以下场景设置以下域名,网站和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上的网站上,用户然后点击指向retailers.mysite.com的链接并且这将解析为主机B上的retailers.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.

您需要知道不同主机的IPAddress或域名。
然后,您可以为子域设置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

ie

*。mysite.com - >记录 - >主持人A

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

retailers.mysite.com - > CNAME - >主持人B

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

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

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