Domain – How to use same domain name to access different servers

domaindomain-name-systemnameserversubdomain

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?

Best Answer

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.

Related Topic