title: What is the difference between 0.0.0.0, 127.0.0.1 and localhost?
body: <p>I am using <code>Jekyll</code> and <code>Vagrant</code> on my mac. I found that <code>Jekyll server</code> will bind to <code>0.0.0.0:4000</code> instead of <code>127.0.0.1:4000</code>. Also <code>gem server</code> will bind to this address by default. I can still visit it via <code>http://localhost:port</code>. But for <code>Jekyll</code>, <strong>it seems that the default setting (e.g. 0.0.0.0:4000) requires Internet access. I cannot run <code>Jekyll server</code> without Internet.</strong> Is it a  small bug?</p>
  
  <p>I also use <code>Vagrant</code>. I have set port forwarding(8080 => 4000) in Vagrantfile, since I install <code>Jekyll</code> in <code>Vagrant</code> virtual machine and test it under Macintosh. If I use the default setting (0.0.0.0:4000), it works. I can visit it from my safari with <code>http://localhost:8080</code>. But if there is not internet, I cannot bind to 0.0.0.0:4000. I use <code>jekyll server -H 127.0.0.1</code> to bind service to <code>127.0.0.1:4000</code> instead, then I cannot visit it via <code>http://localhost:8080</code>.</p>
  
  <p>Can anyone <strong>explain the difference between 0.0.0.0, 127.0.0.1 and localhost</strong>? And can anyone <strong>explain why the difference will cause this problem</strong>?</p>