[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. 127.0.0.1 is not special in this 5 regard. Both ping 127.0.0.1 and ping 192.168.1.44 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:192.168.1.44  Bcast:192.168.3.255  Mask:255.255.252.0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          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 127.0.0.1 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 127.0.0.1 is a loopback 1 address, it is defined in RFC3330

Score: 1

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

Score: 1

No, the packets will not go to the network.

0

Score: 0

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

More Related questions