Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've setup my VM to mimic my DevServer. I've setup my Network Connections to read from my Loopback Adapter 1st, LAN 4th. But for some reason, when I create my connection string: "Provider=SQLOLEDB;Data Source=DevServer; Initial Catalog=myDB; User Id=xxx; Password=yyy" inside an .ASPX file, it ALWAYS reads from the LAN Dev Server, instead of the VM Dev Server.

I don't understand why that is?

It's very frustrating because I have to constantly remove my cat5e cable from the back of the Host computer to break the LAN connection, and then it will read from my VM. And then inevitably, I want to search something on the net, and voila, my connection is unplugged, and I have to plug it back in.

What can I do to change this?

For more information, see the picture below...

http://twitpic.com/4zfmj/full

UPDATE: If I ping "DevServer" from my command prompt, it resolves to "192.168.0.2", which is my VM loopback adapter. So it should work, but then when it goes to through IIS and .aspx, it sees the LAN DevServer. So, apparently something is causing IIS to not listen to the VM and listen to the LAN address instead.

share|improve this question

3 Answers 3

If they are both named "devserver" there is probably a hostname mix up. Try and add the virtual "devserver" to your host file. If it works then, then you have a DNS issue. It may be a result of the computer not being 'smart' enough to go where it should :)

share|improve this answer

Best practice is to use separate server names for your devserver and your vmdevserver. If only need a short-term redirect, then the hosts file solution may fit your need.

Either way having duplicate names on the network (domain?) will be problematic.

rbs

share|improve this answer

This looks to be a name resolution issue - You need to figure out whether the name is being resolved by netbios or hostname - see this article

Then you can add your servername to your hosts and or lmhost file. The side affect of this is that the name will always resolve to your local vm

So you either change your connection string or you have to change your host files

Separate names would seem like the obvious thing to do - that's why everyone else is using them :-P

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.