If you have a properly setup DNS, you should be able to do "ipaddr_t resolve(char *name)" call (from your program) to get the IP of any machine that is registered with the DNS. In your /etc/dhcp3/dhclient.conf file add or change the line with:
send host-name "mycomputer.mynet.com" to whatever your computer name is. Then do a dhclient as root user from a console. On Feb 20, 2:15 am, Patrick Jourdan Evangelista Maia <[email protected]> wrote: > It's a java + linux problem. The code to get the IP address works pretty > well on windows but in linux it needs the /etc/hosts to have a entry with > the local machine's name/ip. I think the java language implementation is > doing this wrong to linux. I'll try to understand how it's implemented. > > On Thu, Feb 19, 2009 at 11:40 AM, Christopher Stamper < > > [email protected]> wrote: > > > On Thu, Feb 19, 2009 at 9:24 AM, Patrick Jourdan Evangelista Maia < > > [email protected]> wrote: > > >> I just wonder if the DHCP client has an option to do this. > > > I don't think it would; this is not really what hosts.conf is for. In other > > words, you are probably the only person who wants to do this... > > > -- > > Christopher Stamper > > > Email: [email protected] > > Web:http://tinyurl.com/2ooncg > > gTalk:http://tinyurl.com/6e359r > > Skype: cdstamper --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ubuntu Linux" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ubuntulinux?hl=en -~----------~----~----~----~------~----~------~--~---
