LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 11-24-2003, 09:00 AM   #1
xailer
Member
 
Registered: Nov 2003
Posts: 77

Rep: Reputation: 15
What is the difference between these two entries?


hi

How do the following two entries(in Hosts file)

127.0.0.1 localhost localhost.localdomain
192.168.0.1 hey hey.YOU

differ from this entry

127.0.0.1 hey.YOU hey localhost.localdomain localhost

?

How do we refer to PC differently on the network in each case?


And how does PC behave if it has these two entries:
127.0.0.1 hey.YOU hey localhost.localdomain localhost
192.168.0.1 hey hey.YOU
?

bye

Last edited by xailer; 11-24-2003 at 09:03 AM.
 
Old 11-24-2003, 11:33 AM   #2
Tomasfuego
Member
 
Registered: Nov 2002
Location: USA
Distribution: Lenny at work
Posts: 168

Rep: Reputation: 30
>Eeek<

Looks like you got your hosts entries backward ... it should go like this:

127.0.0.1 machinename.subdomain(if any).domain.com shortcuts

the 127 is when you want to access your own machine without having to search out the network ... using anything else for your machine will not change anything in practice unless a particular program you want to use requires you to run it from 127.0.0.1 127.0.0.1 is just for your machine, so if you access 127 from another machine, you will be getting things from the "another" machine and not from the first one.

Here is an example hosts file

127.0.0.1 localhost.localdomain localhost
192.168.1.57 www.lacasadetomas.com www
192.168.1.58 email.lacasadetomas.com email
192.168.1.59 ftp.lacasadetomas.com ftp


so, instead of having to remember IP addresses, you can just type "www" in your webbrowser to check out that website (and not just teh web browser either! works in other apps). You could also use this on public Internet sites to avoid the DNS lookups and make the site appear sooner.

As to how the above your stuff behaves, just try it out. I would not change the localhost line since that has affected my ability to print in the past
 
Old 11-24-2003, 02:20 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,985
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Re: What is the difference between these two entries?

Quote:
Originally posted by xailer
How do the following two entries(in Hosts file)

127.0.0.1 localhost localhost.localdomain
192.168.0.1 hey hey.YOU

differ from this entry

127.0.0.1 hey.YOU hey localhost.localdomain localhost
Hi,

firstly it's as Tomas pointed out, you
have them the wrong way around.

Secondly, 127.0.0.1 only refers to
the loopback device, it's just for stuff
that's only happening to and on your
machine. The 192.168.0.1 is an actual
TCP/IP address used in network
communication, most likely bound to
eth0.

Read man ifconfig for more info, and follow
the "suggested reading" (reference to
other commands and files at the bottom
of the man page).


Cheers,
Tink
 
Old 11-24-2003, 04:43 PM   #4
xailer
Member
 
Registered: Nov 2003
Posts: 77

Original Poster
Rep: Reputation: 15
hi

The correct way is 127.0.0.1 hey.YOU hey ;right?

Which of this two machine names is alias?

127.0.0.1 hey.YOU localhost.localdomain localhost ?

Im thinking hey.You ,but Im not shure

One last question...if the name of 127.0.0.1 is localhost,and the name of 192.168.2.3 is hey,then which of this two names will also be a machine name?

thank you
 
Old 11-24-2003, 04:48 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,985
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
man hosts
man hostname



Cheers,
Tink
 
Old 11-24-2003, 05:58 PM   #6
Tomasfuego
Member
 
Registered: Nov 2002
Location: USA
Distribution: Lenny at work
Posts: 168

Rep: Reputation: 30
ON redhat, your login screen will say "hey!" ;-)
 
Old 11-25-2003, 06:59 AM   #7
xailer
Member
 
Registered: Nov 2003
Posts: 77

Original Poster
Rep: Reputation: 15
thank you for your help
 
  


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
/dev entries lord-fu *BSD 2 05-27-2005 08:52 AM
entries in securitylog pippet Linux - Security 1 08-05-2004 05:51 AM
HCL entries? synaptical LQ Suggestions & Feedback 19 02-18-2004 08:04 PM
No entries in iptables? PenguinPwrdBox Linux - Networking 9 02-18-2004 06:58 PM
/dev entries NSKL Linux - Hardware 7 01-08-2003 03:48 PM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration