How to share domain name with multiple servers?

Yes, its perfectly normal and an often used scenario.

Just configure your, for example, Apache server with the same virtual host(s) on both webservers. Remember that hostname/domain is a separate thing from IP address, so server A will have one IP, server B will have another. To control which server you reach when typing the domain name you use DNS. A simple way to use both servers is to use DNS round-robin, simply point the host/domainname to both IP addresses at once.

If you want to use some kind of "failover" situation you can have DNS point at one IP at a time, and manually fail over when needed. Remember then to set the TTL (Time To Live) of the DNS entry rather low, to minimize the failover time.

For more advanced scenarios you might want to use loadbalancer setups.

Please clarify if you need further examples or information. But the short answer is, yes, its possible and often used!


Companies who do this... (mine included) make use of multiple public IPs... load-balancing appliances... sub-domains like www.example.com vs www.sub.example.com and/or reverse-proxies which would proxy requests for www.example.com/sub-site to another server of your choosing.... or some combination of each one. What works for you is really up to what you need.