LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2009, 05:25 AM   #1
praveenks
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
My IP is not persist


Hi,

I had the system assigned with DHCP, The thing is even though ip is showing, it is taking as localhost.

I used following commands to check:

ifconfig------------> ip is there.
hostname -----------> hostname is showing as local host.
hostname -i ---------> ip is showing as 127.0.0.1


i then checked the file vi /etc/sysconfig/network-scripts file
i cant find any change or problem.


so, please help me in resolving this issue.

regards
praveen.
 
Old 10-15-2009, 05:30 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
127.0.0.1 is the internal IP
the IP in your ifconfig is the external
what is the problem?
 
Old 10-15-2009, 07:21 AM   #3
ddaemonunics
Member
 
Registered: May 2008
Location: Romania
Distribution: Debian
Posts: 242

Rep: Reputation: 41
post the content of /etc/hosts
 
Old 10-15-2009, 08:14 AM   #4
adm1329
Member
 
Registered: Mar 2004
Distribution: CentOS 5
Posts: 128

Rep: Reputation: 17
Quote:
Originally Posted by praveenks View Post
Hi,

I had the system assigned with DHCP, The thing is even though ip is showing, it is taking as localhost.

I used following commands to check:

ifconfig------------> ip is there.
hostname -----------> hostname is showing as local host.
hostname -i ---------> ip is showing as 127.0.0.1


i then checked the file vi /etc/sysconfig/network-scripts file
i cant find any change or problem.


so, please help me in resolving this issue.

regards
praveen.
That's because 127.0.0.1 is bound to the hostname in /etc/hosts

This should not be a problem. What issue are you having?
 
Old 10-15-2009, 08:40 AM   #5
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
could you possibly post following
1. ifconfig results
2. /etc/sysconfig/network-scripts file

and of course not to miss out the problem.

do you use this computer to go online and are unable to ?
 
Old 10-15-2009, 10:04 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,669

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
So what is the issue or problem you are experiencing? Your post really does not ask a question or describe a problem. I do not understand "My IP is not persist"

What distribution/version are you running? Some like Fedora for example set the hostname as localhost by default. However, localhost is also the name of the local loopback adapter lo i.e 127.0.0.1. This is normal.

The output of the ifconfig -a command should show all network interfaces. Post the results. If dhcp is working you should see information for eth0 with a assigned IP address. If an IP address is not assigned then dhcp is not working or you may have other network problems. If all you see is information for lo then your network adapter may not be configured correctly.
 
Old 10-15-2009, 11:40 PM   #7
praveenks
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
ip is not stable in my system

Hi michael,


The problem is ip is not be stable in my system.
since when i check for ifconfig it showing 10.112.73.235
when i check for hostname -i it is showing the local host ip(127.0.0.1)
like that.

But for me I want the hostname -i should be 10.112.73.235.
so what to do for these changes.
 
Old 10-15-2009, 11:45 PM   #8
praveenks
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up

Hi,


he problem is ip is not be stable in my system.
since when i check for ifconfig it showing 10.112.73.235
when i check for hostname -i it is showing the local host ip(127.0.0.1)
like that.

But for me I want the hostname -i should be 10.112.73.235.
so what to do for these changes.

Thanks for your kind reply
 
Old 10-15-2009, 11:47 PM   #9
praveenks
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up

Hi,

The problem is ip is not be stable in my system.
since when i check for ifconfig it showing 10.112.73.235
when i check for hostname -i it is showing the local host ip(127.0.0.1)
like that.

But for me I want the hostname -i should be 10.112.73.235.
so what to do for these changes.


Thank you for kind reply.
 
Old 10-16-2009, 12:15 AM   #10
celthunder
Member
 
Registered: Feb 2009
Location: Newton, WI
Distribution: Arch
Posts: 84

Rep: Reputation: 8
hostname -i is supposed to be 127.0.0.1 and as was mentioned to change it change 127.0.0.1 in /etc/hosts to the ip you want though that will probably break a few things...but hey its your choice.
 
Old 10-16-2009, 01:13 AM   #11
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by praveenks View Post
Hi,


he problem is ip is not be stable in my system.
since when i check for ifconfig it showing 10.112.73.235
when i check for hostname -i it is showing the local host ip(127.0.0.1)
like that.
What you have described is the correct setup of your system with a persistent, stable IP. There is nothing wrong with it.

ifconfig is showing you the IP of your network device.
hostname -i is showing you the IP of the loopback interface.
these are different things, they are supposed to have different IPs.

Quote:
But for me I want the hostname -i should be 10.112.73.235.
Why would you want that? This will break your system.
Quote:
so what to do for these changes.
What are you hoping that this will achieve?

Last edited by Simon Bridge; 10-16-2009 at 01:16 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
pf flush persist file problem jack111 *BSD 8 02-04-2009 03:06 AM
persist OMAPI host declarations vortmax Linux - Server 1 06-17-2008 04:05 PM
SCSI-3 Persist Reservation using cciss driver merry Linux - Hardware 2 05-22-2007 01:47 PM
TCP persist timer experiment using nc mohtasham1983 Linux - Networking 1 03-02-2007 04:00 PM
How do I persist MTU change? shame Linux - Networking 2 09-27-2006 05:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:10 AM.

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