LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2010, 12:59 AM   #1
zak100
Member
 
Registered: Jul 2009
Posts: 262

Rep: Reputation: 2
Finding IP address: nslookup or ifconfig


Hi,
I am trying to find IP address. In a socket programming tutorial, I found :
Code:
$ nslookup localhost
command. It gives me a address. However, one colleague told me :
Code:
$ ifconfig
It also returns me inet_addr. But both are different. Kindly tell me the correct method to find IP address? I have also checked the /etc/hosts file but it says "localhost"

Zulfi.
 
Old 10-14-2010, 01:13 AM   #2
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
Quote:
ifconfig is the command to find ipaddress
see man ifconfig

if you see man nslookup you will come to know what is nslookup

Quote:
/etc/hosts contains IP to host-name mapping
 
Old 10-14-2010, 01:37 AM   #3
zak100
Member
 
Registered: Jul 2009
Posts: 262

Original Poster
Rep: Reputation: 2
Thanks for your help on this.

Zulfi.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Security 1 09-15-2009 12:56 AM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 1 09-14-2009 08:31 PM
Address Space Randomization on 2.6.28-15-generic ubuntu 9.04. Finding base address nullprocess Linux - Kernel 0 09-14-2009 10:45 AM
nslookup ip address list hattori.hanzo Programming 10 08-18-2008 08:57 PM
How does the IP address affect nslookup? hello321_1999 Linux - Networking 7 11-30-2004 04:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration