Is it OK to register different IP addresses for one host name in the Hosts file at the same time?

Asked 1 years ago, Updated 1 years ago, 132 views

I have a question about how to use the hosts file.

The system configuration includes two Web Servers (No.1, No2) running IIS on Windows.
The client basically accesses No. 1 and uses the web app.
I would like to request that you access No. 2 when the No. 1 web server stops functioning.

There are no DNS servers or load balancers in the environment, so the hosts on the client PC should be
192.168.0.1 myApp
192.168.0.2 myApp
and registration.

Would it be a problem to register the hosts file with the same name x different IP like this?Or if there is another good way, please let me know.

hosts

2022-09-29 21:21

1 Answers

I don't know the scope of the question, but

Would it be a problem to register the hosts file with the same name x different IP?

Of course, there is no problem.However, I am not sure which one is selected each time I access it, 192.168.0.1/192.168.0.2.
Since it is a web server, there is a possibility that the first request and the next request will be sent to another server.Please share session information with both servers.Failure to share should result in an error.
(If you can share session information, I think DNS will be available...)


2022-09-29 21:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.