大网数据广告活动
服务器运维问答

How to use same domain name to access different servers?

· 52CE 我爱测

I have a bank as my client. They have their internet banking website hosted on one server and corporate website they want to host on a different server, because the vendors managing them are different. Can they use the same domai…

问题原文

原帖链接 · Ross Cooper · CC BY-SA 3.0

I have a bank as my client. They have their internet banking website hosted on one server and corporate website they want to host on a different server, because the vendors managing them are different. Can they use the same domain name (example.com) with different sub domains, to give their customers access to these two sites - like retailbank.example.com for internet banking and www.example.com for corporate website. How can this be done in the simplest way?

已采纳解答

原帖链接 · MadHatter · CC BY-SA 3.0

Yes. Having different hosts behind different fully-qualified domain names (FQDNs) is fine, notwithstanding that the FQDNs are in the same domain. See, for example, my main web server, and my monitoring server, which are under the same domain but are on different hosts in different countries:

www.teaparty.net.       3600    IN      A       178.18.123.145
nagios.teaparty.net.    3600    IN      A       78.47.197.131

Edit you ask where the setting is done. In the DNS, define both A records, each pointing to the relevant IP address. In each server's service configurations (at least for hostname-aware services) tell it which FQDN it should be serving.

Edit 2: on whichever nameservers are authoritative for your domain, let's say those for example.com, you define www.example.com to point to the IP address of the corporate webserver, and retailbank.example.com to point to the IP address of the internet banking server. Given your comment below, where you say you got the domain from GoDaddy, you would set these in GoDaddy's control panel for that domain.

You configure the corporate webserver to serve the appropriate site on www.example.com, and you configure the internet banking server to serve the appropriate site on retailbank.example.com.

Which DNS servers each of these two web servers uses for its DNS lookups is not material; each should use whichever servers are appropriate for its hosting.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-12-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。