hi all :
how to get host ip under Linux ??
hi all :
how to get host ip under Linux ??
Last edited by pinky; 10-15-2009 at 07:16 PM.
google it?
Which operating system are you using? It's platform-dependent. This function is pretty ubiquitous: man gethostbyname(3)
If you understand what you're doing, you're not learning anything.
It depends on what you want. To get the actual network IP address you can use such functions, but to get the global IP address (that is, the WAN IP address and not the LAN IP address) you need to have another computer tell you what your IP address is.
You could use a site like getmyipaddress.com or similar... Or your custom clients can help the server to get its IP address. Although both solutions might be unsafe...
As Epy said, Google it !
In particular for such basic things, asked thousands of times for 20 years...