• 1
name Punditsdkoslkdosdkoskdo

Differrentiate between and

I understand that points to localhost, and so does (correct me if I'm wrong). So, what's the difference between and

They are not the same. is part of the 127/8 network which is reserved and points to the same computer. is a special IP address that means different things depending on context.

In the Internet Protocol Version 4, the address is a non-routable meta-address used to designate an invalid, unknown or non-applicable target. To give a special meaning to an otherwise invalid piece of data is an application of in-band signaling.

You might have mistaken for when you look at netstat and see the local address listening on as, but this is a different way is used.

In the context of servers, means "all IPv4 addresses on the local machine". If a host has two ip addresses, and, and a server running on the host listens on, it will be reachable at both of those IPs.

In the context of routing, usually means the default route, i.e. the route which leads to "the rest of" the internet instead of somewhere on the local network.

  • 0
Reply Report is normally the IP address assigned to the "loopback" or local-only interface. This is a "fake" network adapter that can only communicate within the same host. It's often used when you want a network-capable application to only serve clients on the same host. A process that is listening on for connections will only receive local connections on that socket.

"localhost" is normally the hostname for the IP address. It's usually set in /etc/hosts (or the Windows equivalent named "hosts" somewhere under %WINDIR%). You can use it just like any other hostname - try "ping localhost" to see how it resolves to has a couple of different meanings, but in this context, when a server is told to listen on that means "listen on every available network interface". The loopback adapter with IP address from the perspective of the server process looks just like any other network adapter on the machine, so a server told to listen on will accept connections on that interface too.

That hopefully answers the IP side of your question. I'm not familiar with Jekyll or Vagrant, but I'm guessing that your port forwarding 8080 => 4000 is somehow bound to a particular network adapter, so it isn't in the path when you connect locally to

  • 0
Reply Report