# /etc/hosts questions (e.g., Loopback, domain, etc.)

## digitalwhoopass

My internet connection is working for the most part, and I've followed the install documentation as accurately as I can interpret it.... but I do have a few remaining questions regarding the setup of /etc/hosts.  I'd like to ensure that I've maximized my home network performance and interoperability with my gentoo box and windows boxes.

I have a residential cable modem which is connected to a basic, wired 4-port 10/100 router.  The house has 4 computers, each connected directly to the router. All PCs run WindowsXP except for one, which runs Gentoo 2005.0 (~x86).  The router has been configured to provide static IPs for each system. Below is a brief summary of my IP assignments and corresponding PC names:

192.168.0.101   kanga

192.168.0.102   roo

192.168.0.104   piglet

192.168.0.105   pooh

192.168.0.106   tigger     <~~~ Gentoo box

As far as I know, i have no DNSdomainname (as it is a domestic cable modem)... but I was under the impression that I needed to specify one anyway.  I've been using my Windows Workgroup name "100acrewoods" thinking it might be necessary for SAMBA or some other windows network interoperability reason.... but I'm not sure if I should even be doing this. Can someone make a clarification on this?  Should I be giving my gentoo system a domainname?  Or will this just get in the way?

Also, I've been unable to confirm whether or not I require (or should have) a Loopback address specified in the /etc/hosts file.  Some posts suggested that a loopback is not necessary if I have a static IP, while others suggest adding my hostname to the loopback address line *in addition* to the localhost.localdomain line. Another post said to replace "localhost.localdomain" with my hostname on the loopback line.   Which method, if any, is the correct course of action?  What will make my box the least confused? =)

Here is my /etc/hosts file:

```

127.0.0.1       localhost.localdomain localhost

192.168.0.101   kanga.100acrewoods kanga

192.168.0.102   roo.100acrewoods roo

192.168.0.104   piglet.100acrewoods piglet

192.168.0.105   pooh.100acrewoods pooh

192.168.0.106   tigger.100acrewoods tigger

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

If anyone could help me out by making some tweaks or corrections (and explaining the logic behind the changes), I would sincerely appreciate it!  Thanks for your help!!! =)   :Very Happy: 

----------

## Jas-Nix

 *digitalwhoopass wrote:*   

> 
> 
> Here is my /etc/hosts file:
> 
> ```
> ...

 

Everything looks great to me.   The main reason you would use a hosts file is so that you can ping kanga and it will know to go to 192.168.0.101

If you want you can change localhost.localdomain to localhost.100acrewoods but I am pretty sure it will not effect anything either way.

Hope this helps.

Jas-Nix

----------

## digitalwhoopass

Thanks for you response.

I know the host file reads properly, but what I'm curious about is...

  1) Do I really need the loopback IP if I have a static IP address?

  2) Should I remove the "100acrewoods" part(s), as it's technically NOT a domain name but my windows workgroup name?

  2a) Can I rc-update del dnsdomainname, or should I keep the windows workgroup as my dns domain name?

----------

## Jas-Nix

To be honest I am not sure on the loopback thing, According to the Gentoo Installation docs you MUST have a domainname (I have mine setup as the win worgroup for SAMBA integration)  I do not think you cannot rc-update del dnsdomainname but I do not know, I've never tried it  :Smile: 

----------

## dkmweeks

If it were that simple.

You have /etc/host files.  OK.  What does that have to do with your network services?  Your Gento box doesn't seem to be important to internet services.  Your 4 port router is doing that.

What I could do here is be mean about it, but that's not right.  I've been where you are.

Your lo... ahh, heck, I WILL be mean.

Contact Microsoft for support, regarding your crap boxes.  They'll help you.  Tell them you have an ipv6 question, regading Gentoo Linux and XP.

----------

## mcspiff

 *dkmweeks wrote:*   

> If it were that simple.
> 
> You have /etc/host files.  OK.  What does that have to do with your network services?  Your Gento box doesn't seem to be important to internet services.  Your 4 port router is doing that.
> 
> What I could do here is be mean about it, but that's not right.  I've been where you are.
> ...

 

...what the hell are you talking about? no one has mentioned ipv6.

----------

## digitalwhoopass

 *Quote:*   

> ahh, heck, I WILL be mean.
> 
> Contact Microsoft for support, regarding your crap boxes. They'll help you. Tell them you have an ipv6 question, regading Gentoo Linux and XP.

 

Two people in this thread were/are holding a respectful, mutual dialog.  They both read through the documentation ("RTFM," if you will)...and at least searched through threads, google, and texts looking for specific answers.  When multiple credible sources provide conflicting information, a discussion forum is a perfectly legitimate place to ask about it.

My network works, and my host file works.  I was simply looking to expand my understanding of the how/why and maybe learn something new.  There's no need for you to be rude, dkmweeks.

----------

## dkmweeks

Your right about that.  And I have little excuse on this point.  Except that your loopback device is an ipv6 entry, and you don't even know that.

OK.  I get it, that's why you're here, to learn.  I ask for some understanding on my part, because it looks to me like you are still mostly MCSUsers (Microsoft Certified Software Users), and you're posting on Gentoo.

The host file is very basic to ipv4 tcp/ip.  In the beginning, before dns, there were only /etc/hosts files for the entire Internet.  That was fine for the time, cause DARPA was just getting this thing started.  (The Internet, by the way, is a military technology, developed by the United States to provide command and control communications in the event of a nuclear exchange between the United States and the former Soviet Union.)  In time, this method proved ridiculus.  However, it is still an excellent solution for small networks.  Coupled with dns, it provides the ultimate configuration for local and wide area network address resolution.

The truth of your post is that it hasn't a thing to do with GNU/Linux, Unix, M$, et. al.; it is a communications pardigm, and best treated that way.

I don't know how your network is attached to the Internet, but like I said, it is probably a $100 D-Link, or Linksys, or whatever, router/switch.

There is SO much involved here, you don't realize.  So, in repayment of what ever??, here's some assignments:

Learn what these mean:

DARPA, RFP, ipV4, ipV6, CIDR, Classes A, B, C, D, E, netmask, dns, leaf node,  /etc/services, /etc/hosts, netfilter/iptables, tcp/ip suite, OSI model, IEEE, W3C, address space, binary numeration, ttl, ... 

These are just to put yourselves into the context of networking.  Once you've learned about these, then you'll have a list of programs needed to utilize network services.

One last question:  what do either of you use to edit your host file?

----------

## digitalwhoopass

 *Quote:*   

> OK. I get it, that's why you're here, to learn. I ask for some understanding on my part, because it looks to me like you are still mostly MCSUsers (Microsoft Certified Software Users), and you're posting on Gentoo.

 

Even if we were more Windows-oriented in our understanding of how things work, that shouldn't matter. The question was not about \WINDOWS\system32\drivers\etc\hosts; it was about /etc/hosts, and the way Gentoo/Linux in particular leverages its contents (in the event that its implimentation extends beyond other distros/OSs).  Most Linux users are former DOS/Windows or Apple/Mac users anyway, so treating perceived "newbies" in a hostile manner simply because you sense where they might be coming from is hypocritical at best.  But perhaps you started using BSD, VMS, or some *NIX variant from the beginning as your primary OS?  Whether for the love/intrigue of technology or the GNU philosophy, most (if not all) users migrating to Linux today are Windows/Mac users, and this is a *GOOD* thing.

I'm familiar with how the Internet began, though you obviously could offer a much more intimate account of it than me. And I appreciate the suggested homework; I'm versed on most of those terms/concepts, but I will read up on CIDR and Classes A, B, C, D, E.

 *Quote:*   

> The truth of your post is that it hasn't a thing to do with GNU/Linux, Unix, M$, et. al.; it is a communications pardigm, and best treated that way.

 

You're right, but paradigms and standards are not always consistent in the contexts through which they are applied.

 *Quote:*   

> One last question: what do either of you use to edit your host file?

 

Whatever happens to be available at the time, be it Vi/m, pico/nano, joe, jed...   or even if I have to >> and/or pipe the entries directly from the command line.  Whatever gets the job done.

Why do you ask?Last edited by digitalwhoopass on Fri Jul 01, 2005 9:21 pm; edited 1 time in total

----------

## markkuk

 *digitalwhoopass wrote:*   

> 
> 
> I know the host file reads properly, but what I'm curious about is...
> 
>   1) Do I really need the loopback IP if I have a static IP address?
> ...

 

Yes, you must always have the loopback address associated with the "localhost" name.

----------

## Daniel_walmsley

 *Quote:*   

> DARPA, RFP, ipV4, ipV6, CIDR, Classes A, B, C, D, E, netmask, dns, leaf node, /etc/services, /etc/hosts, netfilter/iptables, tcp/ip suite, OSI model, IEEE, W3C, address space, binary numeration, ttl, ... 

 

Wow what an asshole nice way to try and show off and piss some one off at the same time.

right now you are useing a computer and there are millions of things going on that you dont even know about 

i want you to learn the following 

how to code an os in asm, how to use the auto route featur in Protel (so you can design your own motherboard). propagation delay. PSRR. CMRR. the advantages of CMOS over ttl. 

 *Quote:*   

> OK. I get it, that's why you're here, to learn. I ask for some understanding on my part, because it looks to me like you are still mostly MCSUsers (Microsoft Certified Software Users), and you're posting on Gentoo. 

 

Oh thats right over night you can become a master of a new os. How dare some one tainted by M$ talk here the gentoo forums. 

How do you expect linux to be come popular if people cannot find user friendly application support in the forums. where else are they meant to find it, on the 1800 number??

If you fell someones question is beneith you just ignor them.

----------

## dkmweeks

Ahh....

(and yes, there is (for all of us) some entertainment here...)

digitalwhoopass,

I like your reply, but I don't know how to format it and all, like you did.

Nitpicking:  It's c:\windo.....  OH YEEEAAHHH. Cause M$ boots on C:\

Welcome to things UNIX.  /etc/hosts isn't a Gentoo thingee, its UNIX.  GNU (GNU's Not Unix)/Linux is talent's response to shit for brains, tyranical capitalists.  Those who want to tax thought, expression, communication.  See fsf.org for further details.  /etc/hosts is simply where the OS goes, if property instructed (/etc/resolv.conf) to resolve labeled addresses.  (ip addresses don't need resolution, they simply dump to the gateway, and let the routers take it from there.)

There's nothing hostile here, except for expectations, which are demanded in just this way.  If you can't deal with it.

Yes, most ARE from such roots.  M$ is the most used technology, so it stands to reason, not merit.  Regardless of my roots, (IBM 360, as a hacker youth, electronics, as a hacker child) I spent LOTS of time in M$ affairs.  Actually, my time with M$ predates their OS.  (Operating System)  It was their replacement for Benton Harbor BASIC, MS-BASIC, a huge improvement, in my opinion.  Namely, the TRS-80 (trash 80).  Back in the "day" Unix was the bad boy (ATT Labs), M$ was just another fledgling outfit, happy to work with these things called micro-computers.  It was all new, and the birth of M$ happened on ONE deal:  IBM <licensed> "MS-DOS", as a short-cut to a something they NEVER expected to amount to anything.

The rest is history, and Bill is the first to admitt to luck.  I like that about him.  Yet, he is no boy-made-good.  M$ is best attributed to his father, an attorney.  To this MOMENT, M$ isn't a software company, they are a cult law firm.

Yes, migrating to GNU/Linux IS a good thing.

Regarding the ipV4 address space (nothing to do with domain names!), the RFC's are requisite.

Regarding "contexts" violating standards, uh, that's kind of the point to ALL of this.  M$ corrupts in order to survive, at  !M$'s cost.

I asked about your editor, to see what you know of them, because this is a VERY basic issue, and tells LOTS about where you're at regarding competence in technology.  I assume, then, that you're comforable with the modal nature of VI?  I like VI, cause it nearly everywhere, though Gentoo changes that.  And it is VERY good with C code.  My preference is emacs.  Do you use it from a windowed environtment, or a console?

Also, you used: >>.  What does >> mean, specifically?

----------

## dkmweeks

Ahh....

Daniel_walmsley,

What is showy or pissy about my SHORT list of terminology?  Really?

I'm not trying.

You're right about me being an asshole.

Awareness is a matter of attention, of which we are limited.  So?  The real issue is focus.

What is os?

Assembler is used for tweaking, NOT coding.  For a LONG time now, too.

I like spice.

College.

I could google, possibly whatis, PSSR and CMRR, but I'll hazard RR stands for range registers??

CMOS is a fab process, ttl is organization, shit for nothing.

Not even I learn an OS overnight, not that I know what os means.  What I've done is set expectations, expectations that you'll have to meet, regardless of where you come from.  Tainted?  HELL YEAH!  Coming from  M$ you'll have to unlearn AND learn.

We are friendly.  Yet we must often say things you don't want to hear.  M$ cattors to saying what you WANT to hear.  Welcome to truth and beauty.

I've got to say, my closest understanding of your 1800 number would be the 2600 stuff, of which I played with, when new.

Next.

----------

## digitalwhoopass

 *Quote:*   

> (and yes, there is (for all of us) some entertainment here...)

 

All this time, I was trying to figure out who pee'd in your cornflakes. =)

 *Quote:*   

> I like your reply, but I don't know how to format it and all, like you did.
> 
> Nitpicking: It's c:\windo..... OH YEEEAAHHH. Cause M$ boots on C:\

 

Sub-nitpicking: It's only C:\windo..... if you have the installer place \windows on the C: partition. How ironic that I intentionally omitted the drive specification from my original statement in anticipation of such a retort from you.  Nay you find something to pick on anyway...

I'm just going to take a shot in the dark and assume that you like to identify deficiencies wherever possible.  That's cool; I respect that.

 *Quote:*   

> Welcome to things UNIX. /etc/hosts isn't a Gentoo thingee, its UNIX. GNU (GNU's Not Unix)/Linux is talent's response to shit for brains, tyranical capitalists. Those who want to tax thought, expression, communication. See fsf.org for further details.

 

Propaganda much? If Gentoo had a FOXNEWS Channel of their own, you'd be CEO.  Though I can't say I disagree with most of your statements, as a large number of us are in the freeNIX community for those exact reasons.  Ok, maybe not FOXNEWS... How about NPR?

 *Quote:*   

> Yes, migrating to GNU/Linux IS a good thing. Regarding "contexts" violating standards, uh, that's kind of the point to ALL of this. M$ corrupts in order to survive, at !M$'s cost.

 

Very true and very true. I'm glad to see that we're in accord.

 *Quote:*   

> I like VI, cause it nearly everywhere, though Gentoo changes that. And it is VERY good with C code. My preference is emacs. Do you use it from a windowed environtment, or a console?

 

I only use a windowed environment when I want to perform a task specific to the GUI, or if I'm playing around with some experimental/buggy WM. I was born and raised on CLI, and old habits are hard to break, even this day and age. Though I might make an exception if I owned a Mac. So to answer your question, I do most of my editing from the console.

 *Quote:*   

> Also, you used: >>. What does >> mean, specifically?

 

>> is one form of an I/O redirection command. In the context of my earlier statement, I occasionally use it to echo a string of text to a file from the command line.

----------

## dkmweeks

Cool.

I don't eat cornflakes, or chit.   :Cool: 

Yes, the C: thingee is flagrant.  Can you boot M$ from /dev/!hda????  I've heard of such things, but I've also heard M$ isn't tied to 8.3.

HA!

I'm not into identifying anything in particular.  The whole point <here> is to share education.  I just have lots to spare, and the bills to prove it. :Evil or Very Mad: 

There's no propaganda here regading Unix.  GNU/Linux is a "ripoff" of Unix, a former ATT (Monopoly Phone Company) product, that would cost $1500 dollars a seat, in 1980's dollars, just to get to boot to a prompt.  You weren't there.  It really sucked.  M$ was a blessing at that time, even though it sucked (and still sucks, only more so) as an OS.

What do you know of bash?  And job control?  and virtual consoles?  These questions are a gift from me to you, and anyone else reading this, who answers these questions.  The console is the beginning and the end of competence, things computing.  GUI's are fragile; consoles are cheap.  Here's to the consoles.

The >> redirectors APPEND to a file, rather than clobber.

----------

## dkmweeks

Oh, what is CLI?

----------

## bigfunkymo

I'm guessing Command Line Interface.

----------

## dkmweeks

In that case, we have another breach of culture:  the console is a shell, NOT a command line interface.

And M$ ain't got much of a shell (msdos.sys && command.com).

Now that apple runs on our stuff, they finally have a shell environment.  Yippie!  Soon, they'll be running on Intel.  I think they get it.

----------

## VStrider

Hi, digitalwhoopass and Jas-Nix. 

You need unlimited access on your loopback. Loopback is used by your programs to exchange data between their server and client components. If you shut it down (eg. if you block it with a firewall) some of your programs will stop functioning. So in laymans terms loopback does nothing for your network but keeps your pc working.  :Smile: 

Hope this helps.

dkmweeks, you suck.

Hope this helps.

----------

## dkmweeks

Huh.

----------

