John Lokanis Posted May 27, 2016 Report Share Posted May 27, 2016 I have run into an issue with the Open Application Instance function and multiple DNS entries. I have two applications that I need to communicate across a network. Sometimes one of them is running on a machine connected via VPN. When that happens, the DNS entry for the machine contains both the local IP on the home network and the IP assigned by the VPN on the office network. If I try to lookup the remote machine name from an internal machine on the office network, I get back both IPs. And the order they are returned can change and is random. The problem comes in when I try to open a connection to the remote machine by name using the Open Application Instance function. It will try to resolve the name to an IP internally and then connect. But if the DNS give it the local (home) IP first then it will fail to connect since that IP is not part of the office network. If it give it the VPN IP first then it will work. The problem is I have no control over which IP it will see. And apparently it does not try all of them, only the first one. Does anyone know if there is a way to control this? I need to have it give me the local (LAN) IP if there is no VPN connection and the VPN IP if there are two IPs. And I need it to be deterministic, not random. thanks for any ideas, -John Quote Link to comment
Popular Post smithd Posted May 28, 2016 Popular Post Report Share Posted May 28, 2016 If I'm understanding your problem correctly, I think you can use the 'multiple output' function of string to IP to get all the IPs associated with that host name. If needed, you can do the same with 'localhost' and I think its returned on windows in the same order every time (letting you know if the VPN is connected if your vpn works that way). If your VPN always has the same subnet, you could also just OR the returned list with the VPN subnet and see if you get a match. If not, find the IP which matches your local IP address. Something along those lines. 5 Quote Link to comment
ShaunR Posted May 28, 2016 Report Share Posted May 28, 2016 5 hours ago, smithd said: the 'multiple output' function of string to IP to get all the IPs associated with that host name. Oooooh. Never knew it could do that. Quote Link to comment
John Lokanis Posted May 31, 2016 Author Report Share Posted May 31, 2016 Nice tip! I'll add that one to my bag of tricks. I think I can find a way to use that to solve my issue. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.