Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to build a local network consisting of several computers each of which is running a web server. These web-servers should communicate with each other. But the problem is that IP addresses could be different each time I start the network. So, every server does not know how to find another server.

I know that, in similar situation, people used Java in combination with zeroconf. Zeroconf finds all computers present in the network automatically and gives this information, in same way, to Java. Can I do something similar in PHP?

share|improve this question
What router are you using? Most, if not all, allow for using names rather than IP addresses. Some, if not all, will even automatically honour any name a computer has assigned to itself (as long as it is unique). And if all else fails then most, if not all, routers will allow for static IP addresses... Hence: more details please! – Arjan Mar 1 '10 at 14:02
up vote 2 down vote accepted

The PECL has a Zeroconf extension you could try out. Zeroconf/mDNS is not specific to Java. However, I would recommend using static IP addresses with a known configuration rather than having the additional dependency of Zeroconf.

share|improve this answer

Apache has an Avahi/mDNS plugin called dnssd that can help you with this.

share|improve this answer

I think that you should take a step back and fix the real problem. If you have several servers, each of which need to find each other, then you should assign them static IPs. That is exactly the problem that setting a server to have a static IP is designed to fix, after all.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .