LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-14-2004, 05:45 PM   #1
SeanatIL
LQ Newbie
 
Registered: Jun 2004
Location: IL
Posts: 24

Rep: Reputation: 15
what's difference between ifconfig and "hostname -i"


sorry to ask this stupid question, they gave me different info.

>ifconfig
eth0 Link encap:Ethernet HWaddr 000:B7:A3:5C:FC
inet addr:10.1.144.48 Bcast:10.1.144.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:595502 errors:7 dropped:0 overruns:0 frame:7
TX packets:139996 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:103808093 (98.9 Mb) TX bytes:24454001 (23.3 Mb)
Interrupt:9 Base address:0xde80 Memory:fe9fe000-fe9fe038

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:694 errors:0 dropped:0 overruns:0 frame:0
TX packets:694 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:83497 (81.5 Kb) TX bytes:83497 (81.5 Kb)

>hostname -i
10.1.138.3

why they return different address? (10.1.144.48 and 10.1.138.3)
 
Old 07-14-2004, 07:31 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
*NOTE* i just give the config files i use yours might be different

ifconfig gives settings current for network interfaces (devices) including loopback
from /etc/sysconfig/network-devices
so if someone wants to talk to your NIC eth0 they will have to call 10.1.144.48

OK now each computer or "host" on your network can also be assigned one or more names instead of an IP address the name is linked to an IP address as defined in /etc/hosts

hostname on my system is set in /etc/sysconfig/network
the IP address shown by "hostname -i"
is set in /etc/hosts
where the name is to the right of the assigned IP
if you have multiple IP numbers assigned to "hostname" for some reason then "hostname -i" is just
spitting out the first one it comes to and that's not a problem.
mine says with "hostname -i" 127.0.0.1 and that works fine even though my network interface is something different.
but if you mean for your box to only be 127.0.0.1 and 10.1.144.48
i would change that stray number in /etc/hosts to 10.1.144.48
or if 10.1.144.48 is already defined in there just take the stray line out

Last edited by foo_bar_foo; 07-14-2004 at 07:35 PM.
 
  


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
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 09:40 AM
what is difference between "reset" and "clean " commands? zameer_india Linux - Newbie 2 01-10-2005 06:23 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM
"User" & "System" CPU load difference JJX Linux - General 3 06-06-2004 01:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:34 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