2

For the given input into the url bar:

0.0.0.0:4567/login/re-welcome/

or

http://0.0.0.0:4567/login/re-welcome/

Google omnibox only highlights one option, google search, and does not let me visit the URL I specified. I have provided an appropriate screenshot showing how there is only one selection for my input and upon pressing enter redirects directly to a google search.

This never previously happened, and even after clearing browser history it still performs it.

I am on Mac OSX 10.10.2 and Chrome Version 40.0.2214.111 (64-bit)

Is there a way to fix this? The confusing thing is it never used to do this... So I'm wondering if there's something I'm overlooking.

Middleman server

Screenshot of Omnibox behaviour

11
  • 2
    What are you expecting to happen? 0.0.0.0 is not a valid IP address to navigate to. Chrome knows this, so it only allows you to do what it knows is valid for the given input (ie search).
    – heavyd
    Feb 16, 2015 at 6:41
  • Maybe I need to clarify, I'm running a local server, and it works for everyone else in the office, and it used to work for me, but now I have to use localhost:4567 Feb 17, 2015 at 22:01
  • Ok, that doesn't change the fact that you can't navigate to http://0.0.0.0, its not a valid IP. Perhaps you mean to use http://127.0.0.1 or http://<YOUR_IP_HERE>?
    – heavyd
    Feb 17, 2015 at 22:02
  • What does everyone in the office use?
    – heavyd
    Feb 17, 2015 at 22:03
  • As per extra screenshot supplied, yes I intended to use 0.0.0.0, and everyone else in the office uses the same, or any other ruby developer, when running their own servers on their own machines. Feb 17, 2015 at 22:06

3 Answers 3

3
+50

You should not use 0.0.0.0 in this way. Even if it has worked. Reason: You're bound to bump into troubles.

Using 0.0.0.0 for HTTP communication is a violation of a standard, which officially classifies 0.0.0.0 as an "unusable" address. The term "unusable address" in IPv4 refers to the first address and the last address of any network or subnet. 0.0.0.0 is the first address of every IPv4 subnet that it is a part of.

Having the first address be treated special is discussed (using various ways to specify the notation) by at least RFC 894, RFC 919, RFC 1122, and RFC 3021. The basic reason that it was declared to be "unusable" is that it was treated as a broadcast address. Since then, the more common IPv4 standard is that the last address is a broadcast address, but still, the first address continues to be widely recognized as "unusable". I'm sorry, @harrymc , that I must disagree with comment based on jargon. Even if the address can technically be used, and therefore fits the definition of the English word "usable", there are some technical terms in the networking world, of a "usable address" and an "unusable address". Based on this industry standard jargon, 0.0.0.0 is classified as "unusable".

Perhaps there is no technical reason why the first address must be unusable. This is not the result of a restriction forced by some limit of how many numbers can fit within some group. However, it is a standard by consensus. Rightly or wrongly, that is the reality. People are trained to avoid using this address. As a result, many pieces of software may check to make sure that this standard rule is not being violated.

If you spend enough time getting advanced in networking, you find that a lot of modern networking was designed around the concept of agreeableness. Therefore, consensus is important.

If you wish to try to violate this rule, you're welcome to try. There's lots of "open source" software that you can adjust to your whim. However, if you knowingly violate common standards (or refuse to adapt after learning that you were unknowingly violating common standards), you should not be surprised if you end up with certain troubles. For instance: if the authors of a major web browsing software does not treat an "unusable" address like a normal address.

Besides being unusable, 0.0.0.0 is filled with zeros, and makes it seem very similar in concept to "::" which is officially the "unspecified" address in IPv6. Therefore, treating 0.0.0.0 as the "unspecified" address in IPv4 seems rather sensible, and is consistent with how the netstat command (especially with "netstat -na") does things (in both Unix and Microsoft Windows).

In that sense, DHCP's usage of 0.0.0.0 makes a lot of sense; before an address is assigned, the computer is using the "unspecified" address. Actually, what I suspect the computer is doing is relying on the MAC address of the frame (Layer 2: Ethernet/Wi-Fi) instead of the IPv4 address (Layer 3) so that the right computer is getting the right address.

Some people may think of 0.0.0.0 as referring to the concept of "any" address, perhaps largely since "netsat -na" seemed to do that. If you have some idea of what you want 0.0.0.0 to mean, know that there are some other ideas out there, which are rather widespread. Conflicts and other such troubles are expected for trying a different approach.

Speaking of netstat, you may find that "netstat -nr" shows a routing table entry for "127.0.0.0/8" or "127.0.0.1/8" (IPv4 subnet mask 255.255.255.0), and other network addresses that you have assigned to your network card, but not "0.0.0.0/32" (IPv4 subnet mask 255.255.255.255). Although, you may see that "0.0.0.0/0" (IPv4 subnet mask 0.0.0.0) is set to send traffic to your IPv4 default gateway. That's standard subnetting and routing at work. If you haven't been trained in such techniques, you're best off to not be trying to invent a new set of personal expectations for how 0.0.0.0 ought to work.

Finally, to address Google Omnibox: I have no idea about how that works. However, any usage that relies on 0.0.0.0 is so unstandard that I hereby predict that the software developer (Google, in this case) might make changes at any time. And if they do make changes at any time, they are likely to tick off only a statistically insignificant amount of people. So, your best bet is to not rely on any special way that software currently treats the 0.0.0.0 address. It may be that Google is searching for the text because Google is treating the input (what you typed in the address bar) as invalid text-- something that Google isn't recognizing as a valid address. That's rather what I would expect many web browsers to do.

I do understand the pain you might feel about "it worked before; why did it break?" That's understandable. It may be that the previous way of doing things broke. That's something that you risk whenever doing something that isn't standard. As I mentioned before, since no working behavior is clearly expected by any universal standard, "custom" ("non-standard") behavior can be expected to break at any time. Your best bet, to avoid this, is to use standard techniques that have clearly defined behavior.

If you want an easy-to-type network address, you could use http://10.1.1.1 or a private DNS name (like http://l.l.l.l (a.k.a. http://L.L.L.L)). There are some arguments why a private DNS root is undesirable, but it will likely work with less problems than trying to rely on http://0.0.0.0. Or you could use http://l (for the local web server), and use your hosts file, which you may find is less work than setting up custom DNS, at least for a quick short-term small-scale solution. Those solutions will probably work better than continuing to bang your head against the wall in pursuit of trying to force the world to treat http://0.0.0.0 the way that you want it to.

If you want a solution for having things work with web browsers, follow the advice from heavyd's comment to try http://127.0.0.1 or an IP address that your NIC uses. You could try http://localhost (but other machines, when trying to connect to the web server, should use an IP address other than http://127.0.0.1 or http://localhost or http://[::] )

If you keep insisting on using 0.0.0.0 then you are likely to encounter these issues:

  • It may or may not work, today
  • People will get frustrated with trying to help you since you're violating standards that many other people accept
  • Even if you do get things working today, it may break in the future if you do something like update some piece of software. The update may decide to start treating 0.0.0.0 as a non-normal address.

If you are willing to work around any problems, including adapting source code, then nobody here is trying to stop you. Just don't expect other people to help, because they may see the whole endeavor as a waste of time (compared to the better alternative, which is to just go along with the standards). In the long term, there are other approaches that will require less effort than trying to impose a certain behavior onto the 0.0.0.0 address.

1

From Wikipedia about 0.0.0.0 :

In the Internet Protocol version 4 the address 0.0.0.0 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.

Uses include:

  • The address a host claims as its own when it has not yet been assigned an address. Such as when sending the initial DHCPDISCOVER packet when using DHCP.
  • The address a host assigns to itself when address request via DHCP has failed, provided the host's IP stack supports this. This usage has been replaced with the APIPA mechanism in modern operating systems.
  • A way to specify "any IPv4-host at all". It is used in this way when specifying a default route.
  • A way to explicitly specify that the target is unavailable
  • A way to specify "any IPv4 address at all". It is used in this way when configuring servers (i.e. when binding listening sockets). This is known to TCP programmers as INADDR_ANY. (bind(2) binds to addresses, not interfaces.)

In RFC 1122 the notation "{0,0}" is used to designate 0.0.0.0/x (x being anything from 0 to 32).
Quote:

{ 0, 0 } This host on this network. MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its own IP address.

The address 0.0.0.0 is therefore usable, but not advised, since it can interfere with the correct functioning of other network devices searching for their own IP address in the network. As RFC 1122 states, it is possible to use it as a source address, but it should never ever be used as a destination address.

In your case, you use the address 0.0.0.0 as a substitute for localhost, or 127.0.0.1. This may work today, but may be broken by future updates to some software product that you use.

A good example of this is Chrome, where a recent update has fingered 0.0.0.0 as an illegal address that should be searched rather than used, the same error as when specifying http://1.2.3.

This bug is described in Chromium Issue 428046: Unable to access 0.0.0.0, where the last comment from Jan 29, 2015 by [email protected] says :

To avoid getting hit by mail I'm closing comments on this bug. I've already agreed we need to fix, so there's no need for further arguments trying to convince me to fix :)

So you just need to wait for the fix to find its way into the Chrome release. In the meantime, you can either :

  • Use instead localhost or 127.0.0.1
  • Add a short name in the hosts file, which can even be shorter than 0.0.0.0
  • Use another browser
1

Although you should pay attention to the other two answers saying why using 0.0.0.0 is a bad idea you can still access it by using the Developer Console in Chrome.

Open the console and type

window.location.href="http://0.0.0.0:4567/login/re-welcome/"

Chrome should navigate to the proper address.

Alternatively (@TOOGAM) you can input this javascript directly into the address bar:

javascript:window.location.href="http://0.0.0.0:4567/login/re-welcome/"
1
  • That looks like a reference to the DOM, which means that it can probably also be done via JavaScript. (Perhaps by putting in the address bar: javascript:window.location.href="0.0.0.0"; (include the semi-colon)) Another alternative would be to put that into a Bookmark. Still might not be as easy as just typing L.L.L.L or 0.0.0.0 into the address bar, but I give props to Tyler Hou for an excellent job of having his additional answer add an alternate approach addressing Anti-Fun's alluring attraction.
    – TOOGAM
    Feb 23, 2015 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .