[ACCEPTED]-Does a connection to localhost go out onto the network?-networking

Accepted answer
Score: 24

No packets will hit the network. Unplug 1 your network cable and try it!

Score: 14

Any packets sent to an IP address attached 7 to a local interface do not go out of your 6 host. is not special in this 5 regard. Both ping and ping will transmit and receive 4 ICMP packets over the "loopback network 3 device". You can confirm this by unplugging 2 your Ethernet cable and observing the TX 1 and RX counters.

$ /sbin/ifconfig
eth0      Link encap:Ethernet
          inet addr:  Bcast:  Mask:

lo        Link encap:Local Loopback
          inet addr:  Mask:
          RX packets:992670 errors:0 dropped:0 overruns:0 frame:0
          TX packets:992670 errors:0 dropped:0 overruns:0 carrier:0
Score: 2

The packets will stay on your machine.

The 7 name 'localhost' is an alias from 6 in the hosts file, if you edit the hosts 5 file (UNIX: /etc/hosts Windows: C:\windows\system32\drivers\etc\hosts) and 4 change localhost for any other word then 3 you'll access your local host using that 2 other word.

The address is a loopback 1 address, it is defined in RFC3330

Score: 1

No, it's called loopback for a reason. IIRC, packets 2 to aren't allowed "outside" the 1 computer.

Score: 1

No, the packets will not go to the network.


Score: 0

That depends on name resolution. Try that 1 ping after # echo " localhost" > /etc/hosts.

More Related questions