Saved Bookmarks
| 1. |
Solve : Auto update IP address in Windows Hosts file when failed? |
|
Answer» HI Everyone, Is there a such windows batch file or script that can MONITOR the hostname connection alive. If the ping of hostname failed/down, it will auto update the IP address in the windows hosts file. Example: In windows/drivers/etc/host IP address Hostname 192.168.1.100 SQLServer Let say we do a ping on SQLServer and it failed, batch file will update the IP address from 192.168.1.100 to 192.168.2.100 and now the file should changed to: 192.168.2.100 SQLServer And again when ping failed on SQLServer, it will auto switch back to 192.168.1.100 SQLServer in the Host file.At a prior IT Job I had I needed the networks to be able to self heal for problems between 7 sites with multiple PATHS to share data between the sites. I bought Alert Ping Pro and it monitors for failed connection and upon failed ping connection you can tell it to do a number of things of which one of the things was to execute batch files or EXE's that I created in C++. The Batch or compiled C++ programs I had would reboot hung point to point PRIVATE DSL Modem Bridges as well as redirect network traffic through an alternate path to maintain data COMMUNICATIONS between 7 food stores. Because my employer gave me the ability to buy software I went that route, however you could run a batch in a loop and then depending on what is the issue you can alter the hosts file at that system. http://www.bestshareware.net/alert-ping.htm |
|