Talk:Localhost

From Wikipedia, the free encyclopedia
Jump to: navigation, search
          This article is of interest to the following WikiProjects:
WikiProject Internet (Rated Start-class, Mid-importance)
WikiProject icon This article is within the scope of WikiProject Internet, a collaborative effort to improve the coverage of the Internet on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 Mid  This article has been rated as Mid-importance on the project's importance scale.
 
WikiProject Computing / Networking (Rated Start-class)
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.
Taskforce icon
This article is supported by Networking task force (marked as High-importance).
 

General[edit]


The article is marked "needs additional citations for verification." Is this still valid? if so where? It is chocked full of references now. Jimwelch (talk) 14:14, 23 July 2015 (UTC)


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.

That is a spoofing method , the source ip address 127.0.0.x is faked , in fact an attack script could use any source ip address if it is not expect a response. —Preceding unsigned comment added by 200.43.32.32 (talk) 17:37, 10 November 2010 (UTC)


—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 = "0112454901"; sfgsfg$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.)
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)

v

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)
ping is ICMP, which does not use TCP at all! So, it is wrong to say it will test the TCP/IP stack of whatever. Fabiovh (talk) 12:36, 13 May 2009 (UTC)
yes, it is correct usage. The term TCP/IP is a common name, for historical reasons, of the entire Internet Protocol suite. It doesn't just signify TCP. It's perhaps confusing to some but that's the traditional usage. See the TCP/IP model article. Kbrose (talk) 15:31, 13 May 2009 (UTC)
taken, but can you guarantee that it tests the stack for all operating systems? or does it refer to a specific one? Fabiovh (talk) 09:44, 15 May 2009 (UTC)



This page says that IPv6 localhost is limited to ::1. Page Multicast_address says that all IPv6 addresses that start with ffx1::/16 represent a loopback address. Which one is correct? (i.e. wouldn't ::1 plus all ffx1::/16 be loopback addresses?) Alexis Wilke (talk) 10:49, 11 May 2016 (UTC)

==[edit]

I think there's a typo in the first sentence. In computer networking, localhost is a hostname that means this computer and may be used... — Preceding unsigned comment added by 173.231.123.2 (talk) 16:00, 31 August 2015 (UTC)

Second-level localhost[edit]

The statement

  • DNS registrars are precluded from delegating domain names that include localhost, e.g., localhost.com, in order to avoid the confusion that would result if a DNS lookup appended a specified search domain.[disputed ]

seems to be false — both localhost.com and localhost.net are currently (August 2014) registered and point to active websites. � (talk) 21:00, 27 August 2014 (UTC)


          This article is of interest to the following WikiProjects:
WikiProject Internet (Rated Start-class, Mid-importance)
WikiProject icon This article is within the scope of WikiProject Internet, a collaborative effort to improve the coverage of the Internet on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 Mid  This article has been rated as Mid-importance on the project's importance scale.
 
WikiProject Computing / Networking (Rated Start-class)
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.
Taskforce icon
This article is supported by Networking task force (marked as High-importance).
 

General[edit]


The article is marked "needs additional citations for verification." Is this still valid? if so where? It is chocked full of references now. Jimwelch (talk) 14:14, 23 July 2015 (UTC)


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.

That is a spoofing method , the source ip address 127.0.0.x is faked , in fact an attack script could use any source ip address if it is not expect a response. —Preceding unsigned comment added by 200.43.32.32 (talk) 17:37, 10 November 2010 (UTC)


—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 = "0112454901"; sfgsfg$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.)
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)

v

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)
ping is ICMP, which does not use TCP at all! So, it is wrong to say it will test the TCP/IP stack of whatever. Fabiovh (talk) 12:36, 13 May 2009 (UTC)
yes, it is correct usage. The term TCP/IP is a common name, for historical reasons, of the entire Internet Protocol suite. It doesn't just signify TCP. It's perhaps confusing to some but that's the traditional usage. See the TCP/IP model article. Kbrose (talk) 15:31, 13 May 2009 (UTC)
taken, but can you guarantee that it tests the stack for all operating systems? or does it refer to a specific one? Fabiovh (talk) 09:44, 15 May 2009 (UTC)

==[edit]

I think there's a typo in the first sentence. In computer networking, localhost is a hostname that means this computer and may be used... — Preceding unsigned comment added by 173.231.123.2 (talk) 16:00, 31 August 2015 (UTC)

Second-level localhost[edit]

The statement

  • DNS registrars are precluded from delegating domain names that include localhost, e.g., localhost.com, in order to avoid the confusion that would result if a DNS lookup appended a specified search domain.[disputed ]

seems to be false — both localhost.com and localhost.net are currently (August 2014) registered and point to active websites. � (talk) 21:00, 27 August 2014 (UTC)

I concur. I tried whois on both those domain names and both are registered (May 11, 2016). Alexis Wilke (talk) 10:42, 11 May 2016 (UTC)