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

27

3

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?

MCMastery

Posted 2017-09-17T21:09:27.523

Reputation: 403

Question was closed 2017-09-18T22:06:26.497

6ln(2) at first sight. – YSC – 2017-09-18T14:39:48.820

Are you sure you entered it in a search bar and not an address bar? – David Schwartz – 2017-09-18T16:57:15.347

Answers

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

DavidPostill

Posted 2017-09-17T21:09:27.523

Reputation: 118 938

8Also, 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 – 2017-09-17T21:37:00.040

1@LPChip Yes. My FF is configured with a combined search/url bar (field). I had to enter http://0.693 to reproduce. – DavidPostill – 2017-09-17T21:38:34.520

1I 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 – 2017-09-17T21:40:20.413

@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 – 2017-09-18T05:54:58.883

8Prefixing 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 – 2017-09-18T06:57:16.990

@Joey In my case I get the same result with a ? prefix as with a ' prefix. – DavidPostill – 2017-09-19T06:09:06.207

@David, because the search engine tends to ignore the '. But the ? won't even be part of the search term, as opposed to the '. – Joey – 2017-09-19T08:38:59.087

@Joey Hmm. I get https://www.google.com/search?q=%3F0.693&ie=utf-8&oe=utf-8&client=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. – DavidPostill – 2017-09-19T19:22:19.883

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.

Loren Pechtel

Posted 2017-09-17T21:09:27.523

Reputation: 2 234

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 – 2017-09-18T03:09:56.993

4You missed the part of my answer that explains it ... – DavidPostill – 2017-09-18T09:40:50.427

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 – 2017-09-18T12:53:08.827

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

phuclv

Posted 2017-09-17T21:09:27.523

Reputation: 14 930