The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
IP address of machine harneet2004us UNIX for Advanced & Expert Users 3 04-16-2008 04:54 PM
Getting Unix machine IP address asutoshch Shell Programming and Scripting 6 04-30-2006 08:14 AM
retrieve IP of local machine mridula High Level Programming 1 01-23-2006 12:11 AM
How to get IP Address of machine? Ahsan High Level Programming 7 10-24-2003 11:16 AM
Changing Machine IP address kkinnon UNIX for Advanced & Expert Users 7 08-27-2002 02:17 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-21-2005
Registered User
 

Join Date: Sep 2005
Posts: 20
how to retrieve IP address of a machine

hi

is there is any command that retrieves the IP address of a machine. Also is there any function in c that does the same.

thankx
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-21-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,042
Depends on the exact os and on how the box is configured. Also a box can have many ip addresses. With any fully qualified domain name, you can lookup the ip addresses. Can we assume that you know the fqdn?

One exception: the machine's ip address is 127.0.0.1. Every system can contact itself using this address.
Reply With Quote
  #3 (permalink)  
Old 10-21-2005
vertigo23's Avatar
Registered User
 

Join Date: Jul 2005
Location: SF, CA
Posts: 71
While Perderabo is right about the myriad of configurations a given box can have, on just about every Unix I've dealt with, 'ifconfig -a' will list the configuration, including IP address, for all your network interfaces. Dunno about the C function.

Also, it's certainly possible to configure a machine with no loopback interface. On BSD for example, just run 'ifconfig lo0 delete'. Of course, that'll probably break a lot of stuff ;-)
Reply With Quote
  #4 (permalink)  
Old 10-21-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,042
Quote:
Originally Posted by vertigo23
While Perderabo is right about the myriad of configurations a given box can have, on just about every Unix I've dealt with, 'ifconfig -a' will list the configuration, including IP address, for all your network interfaces.
Code:
#
#
# uname -srm
HP-UX B.11.11 9000/800
# ifconfig -a
ifconfig: no such interface
#
Quote:
Originally Posted by vertigo23
Also, it's certainly possible to configure a machine with no loopback interface. On BSD for example, just run 'ifconfig lo0 delete'.
The rfcs state that address 127.0.0.1 must never leave the originating system. Deleting the loopback interface will cause packets addressed to the loopback address to generate an error and this error constitutes a "contact". ;-)
Reply With Quote
  #5 (permalink)  
Old 11-01-2005
Registered User
 

Join Date: Nov 2005
Posts: 4
show windows ip address

ipconfig/all
Reply With Quote
  #6 (permalink)  
Old 11-02-2005
Registered User
 

Join Date: Aug 2004
Posts: 5
"ipconfig -an"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 06:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66