Talk:Localhost
General
First person in the paragraph about PHP? Doesn't look right to me!
I'm very new to making Wikipedia edits, so I'm not sure if this would be appropriate, but...
I've noticed a significant number of attacks from computers who've named themselves LOCALHOST (no IP recorded in event viewer). This might fool an inexperienced administrator or user into thinking the traffic is safe or just confuse the heck out of them, especially if they ping it and get an instant response from 127.0.0.1.
Is there any way to work this into the article? I haven't found any information about it on the web(though I've tried), so I couldn't reference anything.
—Preceding unsigned comment added by 67.40.64.134 (talk) 22:22, 20 June 2008 (UTC)
Can someone put something about what this is useful for? Thanks! Mark Richards 19:02, 11 May 2004 (UTC)
- Suppose you have an HTTP server on your computer. If you want to check up on it you just type http://localhost/ and you'll be there :-) You can also ping 127.0.0.1 if you need to be absolutely sure that your computer exists. --Ihope127 18:40, 13 August 2005 (UTC)
One use of localhost is in connection scripts where a SQL server may reside on the same system that is trying to connect to it. A PHP connection script example:
$hostname = "localhost";
$database = "DatabaseName";
$username = "root";
$password = "password";
$connectString = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR);
Rather than specifiying the IP address of the server in the script, using localhost is more dynamic since it will ALWAYS refer to the local machine even if you change the IP.
- Well, not really ALWAYS. localhost is in the etc/hosts file. In theory, localhost could be made to point to any IP you'd like. But the two alternatives (using localhost or using 127.0.0.1) are about equivalent because to get either of them to no longer work would require manual intervention on the part of the user. Either to change the hosts file or to disable the loopback interface. Baggend 11:33, 20 April 2007 (UTC)
Another use the localhost reference is to test a Network Interface Card or NIC or your TCP/IP stack. A command line example:
Ping localhost
The result is pinging yourself. If no response is received there is a problem on the local machine not the network you may be working with. If you were to talk to yourself you would be considered a schizophrenic, with your comptuer on the other hand it may be desirable.
Hope these help!
Cheers,
Michael Andrade 16:46, 20 Aug 2004 (UTC)
- Actually it won't test your NIC. 127.0.0.1 is entirely implemented in software.
- Also, what's 127.0.0.2 etc. for? Jibjibjib 07:29, 18 January 2006 (UTC)
- 127.0.0.2-8 are also reserved for loopback, it says so in the article. --Ifrit 09:41, 26 April 2006 (UTC)
- Right, but is there a case where you'd want to use 127.0.0.2 (or another loopback IP) instead of 127.0.0.1? What was the logic of reserving a whole /8 block in IPv4, as opposed to the single address in IPv6? (Possible explanation: testing that a server only responds to requests from (a) certain IP(s), without needing WAN requests.)
- 127.0.0.2-8 are also reserved for loopback, it says so in the article. --Ifrit 09:41, 26 April 2006 (UTC)
- Not sure about others, but I use it to placate a piece of software with an annoying license manager. It wants a fixed IP address that always points to my computer, but it won't use 127.0.0.1. My real IP address changes when I go from one network to another, so I just use 127.0.0.2. :-) --Reuben 07:04, 5 April 2007 (UTC)
- Yes, I can also see reasons why a whole network can be useful, instead of a single IP. The reason why it's such a large network is probably that back in the time, plenty of IP addresses were available and nobody thought that we might be starving on IP addresses 30 years later. 83.79.34.243 09:22, 3 June 2007 (UTC)
- I have found that the entire 127.x.x.x loops back (and the only thing in the hosts file is 127.0.0.1) . This could just be Windows specific and I was wondering if anyone could quote a source that specifically specifies 127.x.x.x as loop back. —Preceding unsigned comment added by 68.211.149.39 (talk) 03:16, 7 December 2007 (UTC)
- You are correct ... though I can't cite an on-line source. You can indeed use any address in the 127.0.0.0 network space. Yes the host file provides a default 127.0.0.1 localloop config but even that isn't cast in stone. I'd change the article but I expect someone would want a citation. :? -Ikester (talk) 15:16, 21 February 2008 (UTC)
- I have found that the entire 127.x.x.x loops back (and the only thing in the hosts file is 127.0.0.1) . This could just be Windows specific and I was wondering if anyone could quote a source that specifically specifies 127.x.x.x as loop back. —Preceding unsigned comment added by 68.211.149.39 (talk) 03:16, 7 December 2007 (UTC)
Why 127
Does anyone know why specifically 127.0.0.1 is the address of the local machine?
- What’s so special about 127?
- I would have thought 0.0.0.1 for example would have been the most logical choice or maybe even 1.0.0.0
- Note that 127 in binary is 01111111... maybe it's got something vaguely to do with that?
- Quite simply, yes. The entire loopback address in binary is 01111111.00000000.00000000.00000001 --Ihope127 18:37, 13 August 2005 (UTC)
- To answer those questions: In the old Classful network structure, 127.0.0.0/8 was the last (highest possible) class A network. It was and still is common to use border elements from a set for special purpose. Any other class A network, like 100.0.0.0/8 would have been arbitrary and make less sense. Also, the network 0.0.0.0/8 has already a different purpose and meaning so this is probably the reason why 127.0.0.0/8 was chosen. 83.79.34.243 09:17, 3 June 2007 (UTC)
theres no way this is differnt for anyone else right the local host is always that right o.O
- just had an argument with a n00b and hes telling me im wrong and his local host always changes >.>;;
- message me on <<e-mail address censored>> about this k?
- just a word of caution, you might want to delete your email address from here. i would do it for you but i dont know if you arer ok with putting your email out there. this is wikipedia, but i bet there are still sum people out here who would abuse having some random person's email address. Jds10912 03:24, 21 January 2006 (UTC)
- As he put his email adress there to be contacted I doubt that he is checking up on this page. Deleted the address... (reverting is possible anyway)
- just a word of caution, you might want to delete your email address from here. i would do it for you but i dont know if you arer ok with putting your email out there. this is wikipedia, but i bet there are still sum people out here who would abuse having some random person's email address. Jds10912 03:24, 21 January 2006 (UTC)
Humor section
The humor section (or at the very least, the jokes at the top of it) isn't appropriate for a non-humor-related encyclopedia article. Deleting the jokes.
- Matthew0028 05:47, 18 August 2005 (UTC)
- "There's no place like 127.0.0.1"
- "127.0.0.1? Nice FTP site, but I already have that stuff."
- "127.0.0.1, sweet, 127.0.0.1" (as in "Home, sweet home").
I'll stick that in WP:BJAODN. I think it's roaringly funny (but then, does anyone else?)~user:orngjce223how am I typing? 19:08, 8 December 2006 (UTC)
Kind of related but I removed "All of which are fun" from the end of the urban legends bit. POV - Sas
127.0.0.1 Security : Apache Servers
It is possible to block access to your server, in this case localhost (i.e. 127.0.0.1) in quite a simple manner, according to the concise, comprehensive overview i referenced on this topic. Though i knew it was possible, i wasn't quite sure of the capacity, nor precisely the correct syntax.
I wanted to find a way to block media from IP's other than localhost during development. (though i do not find them be malicious, it might illustrate better the meaning of "media from IP's other than 127.0.0.1-- the Syndicated content one might acquire from Google® AdSense™, or Yahoo! MyWeb Badge, for example.) Whatever the purpose might be for "blocking" the outside sources, i've copied here the text of a fine resource i found at javascriptkit.com (a credible resource, IMHO):
Blocking users by IP
order allow,deny deny from 123.45.6.7 deny from 012.34.5. allow from allYou can deny access based upon IP address or an IP block. The above blocks access to the site from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.)[...]†
You can also set an option for deny from all,[or] allow or deny by domain name rather than IP address (allow from .javascriptkit.com [...])
†Original content snipped, not altered otherwise by this Wikipedia User
Blocking Users by IP: Comprehensive guide to .htaccess. Copyright © 1997-2007 JavaScript Kit. Available at: http://www.javascriptkit.com/howto/htaccess5.shtml . Accessed: Apr-30, 2007. Jsabarese 02:57, 30 April 2007 (UTC)
SetCookie on Localhost with PHP and Apache
Well, it might have to do something with weariness since I just finished proxy configuration for our network (and still do not understand why computers in another domain are fetching OUR wpad.dat) ... but I do not understand, what has the PHP function SetCookie to do with encyclopaedical article about localhost? Does Wikipedia supply PHP-Manual? What will be next, shouldn't we mention that there is no way to capture packets on local loopback in SunOS with Ethereal? --Kavol 20:31, 19 February 2006 (UTC)
- SetCookie is obviously a function that writes a cookie to your computer, maybe this person was having trouble with SetCookie on their server.
- Also, some people think this is a support talk, so for those of you who need help with any PHP-related queries, please use the the PHP Manual, [www.php.net/manual]. Thanks. Teckie 20:04, 15 April 2006 (UTC)
Humor again
I am removing the humor section as I do not believe it is relevant encyclopedic content. If you disagree, please discuss it here instead of reverting. --J Morgan(talk) 21:07, 9 August 2006 (UTC)
- Maybe it's time for some real jokes? Like, putting 127.0.0.1 in someones blacklist? - Face 20:09, 25 September 2006 (UTC)
- I think they may fit in, under a Cultural References section. One of my favs (likely fake but fun anyway). — RevRagnarok Talk Contrib 21:43, 25 September 2006 (UTC)
... September 25, 2006 by TrueRock2 Oops - I just finished putting the humor/myth content back into the article. I was so shocked to not see it in the article I assumed it was some type of mistake. Regardless, I think you are going to have trouble divorcing reality from the article. If there is just one piece of info about 127.0.0.1 that is part of our universal knowledge it is this story/prank. My expectation of a Wikipedia article is to see every piece of information on a topic - especially information that would be known by any knowledgeable and educated individual.
127.0.0.1 is maybe the _only_ IP-address with some cultural background so I _demand_ bringing the insider-jokes back. Thats like writing an article about Jerry Lewis and refusing to point out his humor because it is a serious article. Crass Spektakel 21:20, 7 November 2006 (UTC)
- Okay, you all have convinced me that there should be some mention of the cultural meaning of 127.0.0.1. When I removed the humor section, it was a full 41% of the article (by word count, 251 out of 608 in MS Word). I still think that would be excessive. On another note, I don't object to a humorous example, but I also don't think this page should become a list of jokes. My suggestion is now to keep the section (as of edit 85687792), and ensure that the technical description of 127.0.0.1 remains the primary topic --J Morgan(talk) 18:40, 9 November 2006 (UTC)
Urban Legends
Why is the Urban Legends section flagged as not citing its sources? It's about urban legends, what sources could be cited? I also think this section has no use or bearing on an encyclopedic article about localhost, but I'll leave that up to you. dimo414 03:56, 19 April 2007 (UTC)
- Yeah, I'm not really sure what references you'd cite for an urban legend. And I'd have to disagree on the question of whether or not that section should be included. See "Humor again" for some reasons why. I'd say that localhost actually has more SOCIAL relevance than it does TECHNICAL relevance. Baggend 11:38, 20 April 2007 (UTC)
Difference
Can a computer distinguish between a loopback at 127.0.0.1 and, say 127.5.5.5? For example, is it possible to have two different local webservers at these addresses?--Abdull 13:33, 29 May 2007 (UTC)
- Yes. They're two distinct addresses. Keep in mind that localhost is only really "special" because of the default use of it versus other IP's. But just as you could have a single network device with 3 different IPs, you can have a single localhost with 3 different IPs. It's just that in the case of 127.0.0.0/8 you don't have to do any extra work, whereas with, for example, 10.0.0.0/8 you'd have to manually set up those additional IPs. Note, however, that this distinction could be broken by sloppy code. For example, if you have a configuration directive which takes an IP address as an argument, but you only use that IP to figure out which INTERFACE to listen on, then this wouldn't work. Baggend (talk) 09:38, 22 December 2007 (UTC)
Doesn't make sense!
It doesn't make any sense! Why the dollar sign?137.240.136.86 16:16, 1 December 2007 (UTC)
- In php the dollar sign indicates a variable see Dollar sign#Use in computer programming. --Salix alba (talk) 17:56, 1 December 2007 (UTC)
Ref 1 in German
Reference #1 is in German and should be removed. 12.155.246.10 (talk) 21:31, 3 January 2008 (UTC)
- Being in a foreign langauge is not in itself a reason for any reference to be removed. The encyclopedia is in English, true, but it may reference foreign language sources when the source gives appropriate information. —Lowellian (reply) 01:04, 3 March 2008 (UTC)
::1/128 -- what about ::1?
I've always known IPv6 localhost as ::1, what's the difference? Oh, and it would be nice if ::1 and ::1/128 could redirect here, but it seems the software doesn't agree. :( —Preceding unsigned comment added by Daniel-Dane (talk • contribs) 13:56, 17 June 2008 (UTC)
Yeah...
http://en.wikipedia.org/wiki/Special:Contributions/127.0.0.1