Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No loopback address in /etc/hosts

Status
Not open for further replies.

warmongr

MIS
Mar 17, 1999
214
US
Two related questions:

1. Why would someone intentionally not set the loopback address in their hosts file.

2. What are the possible effects of this?

I think I know the answer but wanted to get everyone's take.

Thanks,
 
I will put my response in context example. In my (work) hosts file, I have entries such as: 127.0.0.1 kona.kontera.com - with my loopback address.

The idea for this is that when there is a link in a web page to kona.kontera.com, which is one of those stinking in text ads, that the URL will resolve to local host and in doing so it will bypass loading the ad.

Another reason why someone would want to put the loopback address in hosts is if you want the system to check it self (i.e. its own servers) for information. For example, if the server is the LAN DNS server, you want it to loop back on itself to access the resolver.
 
Is this the question? "why would somebody want it so that 127.0.0.1 is *nowhere* in /etc/hosts at all"?

I can't imagine any case where this would be a good idea. Usually localhost is in /etc/hosts mapping to 127.0.0.1, and a lot of applications refer to "localhost" when they want the loopback address. If /etc/hosts doesn't have an entry for localhost, these apps might then need to run a DNS lookup on the localhost hostname, and most likely wouldn't find any result. This would likely cause problems.

Code:
127.0.0.1 localhost localhost.localdomain

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Kirsle,

That is the question and you confirmed what I suspected. One of my developers told me that the site he came from supporting did not have a localhost entry in the /etc/hosts file and I suggested the same possible result you did. I was just looking for a second opinion to back me up. You get the door prize.

Thanks,
W
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top