27

While working on math, I encountered a number and wondered if it had any significance. So, in the browser search bar I entered it ("0.693"). I got redirected to the IP address 0.0.2.181, which resulted in an "unreachable" error message.

Why did I get redirected to this IP address?

2
  • 6
    ln(2) at first sight.
    – YSC
    Commented Sep 18, 2017 at 14:39
  • Are you sure you entered it in a search bar and not an address bar? Commented Sep 18, 2017 at 16:57

3 Answers 3

47

Why did I get redirected to this IP address?

The browser address bar sees a . and thinks it is an IP address.

This gets passed to Windows to do a DNS lookup:

> nslookup 0.693
Server:  UnKnown
Address:  192.168.42.129

Name:    0.693
Address:  0.0.2.181

Note:

693 = 256 * 2 + 181

So 0.693 gets translated to 0.0.2.181.


How can I prevent this conversion?

Prefix the value with '.

Enter image description here

8
  • 8
    Also, many browsers have an actual search bar next to the address bar. Typing the search in there works as well. And there are also browsers who can search by typing g search phrase in the addressbar, such as Opera, Vivaldi and other chromebased browsers.
    – LPChip
    Commented Sep 17, 2017 at 21:37
  • 1
    @LPChip Yes. My FF is configured with a combined search/url bar (field). I had to enter http://0.693 to reproduce.
    – DavidPostill
    Commented Sep 17, 2017 at 21:38
  • 1
    I might be mistaken, but it seems to be because it has a dot so it is identified as url which goes to dns lookup, and for some reason Windows is happy to resolve it as ip address.
    – PTwr
    Commented Sep 17, 2017 at 21:40
  • @LPChip you can also assign keywords in FF like that. I always use a separate search box so I'll just need Ctrl+L for entering addresses and Ctrl+K for searching
    – phuclv
    Commented Sep 18, 2017 at 5:54
  • 9
    Prefixing with ? usually starts a search and prevents all further processing. In your case, when you prefix with ' you get a search term that contains the apostrophe.
    – Joey
    Commented Sep 18, 2017 at 6:57
7

The reason 0.693 becomes 0.0.2.181 has been explained by DavidPostill. In short, the string looks like a valid IP address

Now to search for any terms use Ctrl+K (works in Firefox and Chrome) or Ctrl+E (only in Firefox). That'll trigger a search instead of letting the browser to guess if that's a valid address or not

7

DavidPostill explained why you got redirected but didn't touch on how the number changed from 0.693 to 0.0.2.181.

What's going on here is that while IP addresses are normally described as <number>.<number>.<number>.<number> they are really just 32 bit unsigned values, the dot notation is for convenience and really is just the value split into 4 8-bit groups separated with dots. While input normally is in the 4 group notion the parsers always accept it as a number.

693 = 256 * 2 + 181.

3
  • 5
    See also, Why does pinging 192.168.072 (only 2 dots) return a response from 192.168.0.58? for a more complete explanation.
    – Bob
    Commented Sep 18, 2017 at 3:09
  • 4
    You missed the part of my answer that explains it ...
    – DavidPostill
    Commented Sep 18, 2017 at 9:40
  • You need to escape <number>.<number>.<number>.<number> with backticks, because Stack Exchange's markdown parser is dumb and strips anything that resembles HTML rather than escaping it.
    – IMSoP
    Commented Sep 18, 2017 at 12:53

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