What's a way for a client to automatically resolve the ip address of a server?

Posted by zooropa on Stack Overflow See other posts from Stack Overflow or by zooropa
Published on 2010-04-28T13:29:37Z Indexed on 2010/04/28 13:33 UTC
Read the original article Hit count: 293

The project I am working on is a client/server architecture. In a LAN environment, I want the client's to be able to automatically determine the server's address. I want to avoid having to manually configure each client with the ip address of the server. What is the best way to do this? Some alternatives I have thought about doing are:

  1. The server could listen for broadcast packets from the clients. The message from the client would be a request for the IP address of the server. The server would respond with its address.
  2. The machine running my project's server could also have a bind server running. The LAN's router could be configured to use it as one of its DNS servers.
  3. I think I saw that there is a bind library. Does that mean I can build the bind service into my server so that bind doesn't have to be installed on the server?

Any other ideas? What have you done in the past? What are the pros/cons of these approaches and others that might be suggested?

Thanks for your help!

© Stack Overflow or respective owner

Related posts about client-server

Related posts about bind