Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

3 Answers 3

up vote 1 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

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

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

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.