Why does searching "0.693" bring me to "0.0.2.181"?

5,563

Solution 1

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

Solution 2

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

Solution 3

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.

Share:
5,563
MCMastery
Author by

MCMastery

I created s-lang, a string manipulation golfing language which is brand new and still needs a lot of work... you can try it here

Updated on September 18, 2022

Comments

  • MCMastery
    MCMastery almost 2 years

    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?

  • LPChip
    LPChip almost 7 years
    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.
  • DavidPostill
    DavidPostill almost 7 years
    @LPChip Yes. My FF is configured with a combined search/url bar (field). I had to enter http://0.693 to reproduce.
  • PTwr
    PTwr almost 7 years
    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.
  • tvdo
    tvdo almost 7 years
  • phuclv
    phuclv almost 7 years
    @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
  • Joey
    Joey almost 7 years
    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.
  • DavidPostill
    DavidPostill almost 7 years
    You missed the part of my answer that explains it ...
  • IMSoP
    IMSoP almost 7 years
    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.
  • DavidPostill
    DavidPostill almost 7 years
    @Joey In my case I get the same result with a ? prefix as with a ' prefix.
  • Joey
    Joey almost 7 years
    @David, because the search engine tends to ignore the '. But the ? won't even be part of the search term, as opposed to the '.
  • DavidPostill
    DavidPostill almost 7 years
    @Joey Hmm. I get https://www.google.com/search?q=%3F0.693&ie=utf-8&oe=utf-8&c‌​lient=firefox-b-ab in the search bar. The ? is encoded as %3F. I do have FF configured to have a combined URL and Search bar though.