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 have two computers. One of them has a server running, the other has an application that communicates with that server. These computers are deployed to various sites. Sometimes these computers can be wired directly together, other times they will only be connected over a wireless connection I don't control. As an additional requirement, the server also needs to be able to access the internet using dhcp if a connection is available. The goal is to be able to set these computers up in an office, then deploy them to a site with almost no on-site configuration.

What can I do to ensure that the computer running the application can always (or as in as many cases as possible) can find the server and communicate with it (HTTP over port 80).

My thought is to setup the server with multiple IPs. It can access the internet using DHCP on one. The other will be set to a static IP. The application computers will be configured to know this static IP address ahead of time and make requests to it. However, in the tutorials that show how to accomplish it, I must enter my gateway and subnet mask. And won't these change depending on the network I join?

Please excuse me if I'm missing something exceedingly obvious or overlooking other factors. I know next to nothing about networking.

If there's a piece of hardware that can help, that's fine.

This is vista and xp.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

Trying to guess what static IP address won't clash is asking for trouble. As derobert suggested multicast DNS + DNS-SD is a good fit. The only stack for Windows is Apple's Bonjour implementation which will give you the capability to register and resolve your service on the local network as well with some further configuration, punch a hole through the firewall (if the router supports NAT-PMP or uPnP) and update a DNS zone with the appropriate DNS-SD records.

You'll likely need to do some scripting to tie Bonjour to your application's configuration but without know what your application is it's hard to say what would be a good fit. That said, the dns-sd.exe command-line utility automated with a simple batch or WSH script could do the job as could the various bindings for Python, Perl or Ruby for less trivial configurations.

share|improve this answer

The way this is usually solved to use one of the several service discovery protocols already available. For example, see Wikipedia's Zeroconf article. Multicast DNS + DNS-SD seems to be the current popular and widely supported method, though there are others (and the Wiki mentions most).

For example, there exists a mod-dnssd for apache2 that lets Apache use Avahi to announce itself over multicast DNS.

share|improve this answer

Since it seems like they will almost always be on the same network, couldn't you just run WINS on the "server" computer and connect by NetBIOS name?

That way you don't need to worry about the IP Address at all.

Actually, now that I think of it, you probably don't even need WINS, NetBIOS should be able to handle it.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.