Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!zephyr.ens.tek.com!tekcrl!terryl From: terryl@tekcrl.LABS.TEK.COM Newsgroups: comp.unix.wizards Subject: Re: Determining one's own IP address. Message-ID: <5215@tekcrl.LABS.TEK.COM> Date: 12 Dec 89 18:44:55 GMT References: <601@bmers58.UUCP> <4429@ur-cc.UUCP> <604@bmers58.UUCP> Reply-To: terryl@tekcrl.LABS.TEK.COM Organization: Tektronix, Inc., Beaverton, OR. Lines: 14 In article <604@bmers58.UUCP> davem@bmers58.UUCP (Dave Mielke) writes: >In article <4429@ur-cc.UUCP> leadley@uhura.cc.rochester.edu (Scott Leadley) writes: >> Assuming (a lot of things, but primarily that) you wish to do this from >>the shell command line and that you know the network interface name: > >I would like to be able to determine my local IP address without >involving a hosts file or yp lookup, i.e. from memory, from within a c >program. Well, as they say (whoever THEY are!! (-:), RTFM (at least for a BSD system): sethostid(2), gethostid(2), hostid(1)