DEV Community

Discussion on: How can I share the same domain with two different servers?

Collapse
 
rembou1 profile image
remi bourgarel

The dns solution doesn't work well from.my experience and is not supported by every client

Collapse
 
hexrcs profile image
Xiaoru Li • Edited

Do you mean not supported by every DNS provider out there? It's true in that case. I don't have experience doing this myself but I believe most standalone DNS service providers have this feature, if the default DNS servers the domain registrar assigned for you do not.

All the major sites and CDN out there use this technique to do load balancing. That's why you get different IPs for google.com from different places.

Thread Thread
 
rembou1 profile image
remi bourgarel

No, I guess every dns provider manages it but it needs to be also implemented at the browser level : if the resolved address doesn't answer on port 443 then try the next address. I use this only for internal service for which I don't want to pay for load balancer

Thread Thread
 
hexrcs profile image
Xiaoru Li

I see what you mean. However the availability checking should be done by the load balancer, not the client side.

The client simply asks a DNS server to resolve a domain to an IP so it can access it; the DNS server then answers the client with an IP of a server that's optimal for the client (based on location, server load etc). But normally there are layers of load balancing going on and you combine these two types of methods, so the DNS server in that case returns the IP of a load balancer server, and the load balancer server relays/forwards the user requests to the actual, hidden end servers.

Thread Thread
 
rembou1 profile image
remi bourgarel

I was answering to your second solution where the dns resolves to multiple ip. A ha loadbalancer is a must have if you need to send load to multiple servers.