1

How can I realize a domain resolve to 2 IP addresses?

I want to realize domain resolve to IP load balancing.

The bellow is my requirement architecture:

enter image description here

I want to the domain www.mydomain.com resolve to two IP address, if one server is down, then the business will not stop. how can I realize my requirement?

244boy
  • 615
  • 3
  • 14
  • 27

1 Answers1

0

You can't. You need a load balancing server that listens at one IP address to which your domain will resolve, which forwards HTTP requests to the actual web servers. These are called “upstreams” in Nginx terms. You can set up as many as needed, and Nginx will also perform the necessary checks to not forward requests to upstream resources that are down.

There is a way to point one domain to multiple IP addresses, through “round robin DNS”, but this won't help if your clients request the IP address of a web server that happens to be down.

slhck
  • 228,104