The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 01: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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-21-2005
mridula mridula is offline
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
  #2 (permalink)  
Old 10-21-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
  #3 (permalink)  
Old 10-21-2005
vertigo23's Avatar
vertigo23 vertigo23 is offline
Registered User
  
 

Join Date: Jul 2005
Location: SF, CA
Posts: 73
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 ;-)
  #4 (permalink)  
Old 10-21-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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". ;-)
  #5 (permalink)  
Old 11-01-2005
sery sery is offline
Registered User
  
 

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

ipconfig/all
  #6 (permalink)  
Old 11-02-2005
yeniaoer yeniaoer is offline
Registered User
  
 

Join Date: Aug 2004
Posts: 5
"ipconfig -an"
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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