Live data from Hacker News

Shortest URLs on the Internet

jameswillia.ms

11–20 of 208 posts

Re: Shortest URLs on the Internet

#11
At one point of time, `http://to` resolved to a "It works!" page [1]. I've always thought it would be cool to have a URL shortener with links such as `https://to/library` or something similar. Oh, how much fun running your own TLD would be...

[1] https://web.archive.org/web/20150319211308/http://to/

Re: Shortest URLs on the Internet

#12
post #8
post #3

Close second: http://1.1

Why does 1.1 resolve to 1.0.0.1? I don't recall this being in any of the documents about CIDRs. Are browsers implicitly mapping IPv4 addresses temporarily into IPv6 addresses during parsing, such that "1.1" becomes "1::1", and then gets IPv6 abbreviated-form expansion applied to it?

I'm also curious. Especially since curl 7.64.1 (Release-Date: 2019-03-27, on macOS) says:

  % curl 'http://1.1/'
  error code: 1003
while curl 7.85.0 (Release-Date: 2022-08-31, on FreeBSD) says:

  % curl 'http://1.1/'
  
  301 Moved Permanently
  
  301 Moved Permanently
  cloudflare
  
  

Re: Shortest URLs on the Internet

#13
post #8
post #3

Close second: http://1.1

Why does 1.1 resolve to 1.0.0.1? I don't recall this being in any of the documents about CIDRs. Are browsers implicitly mapping IPv4 addresses temporarily into IPv6 addresses during parsing, such that "1.1" becomes "1::1", and then gets IPv6 abbreviated-form expansion applied to it?

There's some weird legacy parsing for IPv4 addresses with less than four components. 1.2.3.4 can be represented equivalently as 1.2.772, 1.131844, or 16909060. (Note that 772 = 0x0304, 131844 = 0x020304, and 16909060 = 0x01020304.)

TL;DR: the second "1" in "1.1" is treated as a 24-bit integer.

Longer explanation: https://blog.dave.tf/post/ip-addr-parsing/

Re: Shortest URLs on the Internet

#14
post #8
post #3

Close second: http://1.1

Why does 1.1 resolve to 1.0.0.1? I don't recall this being in any of the documents about CIDRs. Are browsers implicitly mapping IPv4 addresses temporarily into IPv6 addresses during parsing, such that "1.1" becomes "1::1", and then gets IPv6 abbreviated-form expansion applied to it?

https://en.m.wikipedia.org/wiki/IPv4#Addressing

> IPv4 addresses may be represented in any notation expressing a 32-bit integer value.

I remember reading a man page that explained this really succinctly but I cannot remember which one it was. A tool like ping I believe.

Re: Shortest URLs on the Internet

#15
post #8
post #3

Close second: http://1.1

Why does 1.1 resolve to 1.0.0.1? I don't recall this being in any of the documents about CIDRs. Are browsers implicitly mapping IPv4 addresses temporarily into IPv6 addresses during parsing, such that "1.1" becomes "1::1", and then gets IPv6 abbreviated-form expansion applied to it?

I suspect it gets mapped to 1.0.0.1 because no other resolution is possible. Any other locations for the two zeros results in an invalid IP (either starting or ending in 0).

Re: Shortest URLs on the Internet

#17
post #8

Earlier quoted context omitted.

Why does 1.1 resolve to 1.0.0.1? I don't recall this being in any of the documents about CIDRs. Are browsers implicitly mapping IPv4 addresses temporarily into IPv6 addresses during parsing, such that "1.1" becomes "1::1", and then gets IPv6 abbreviated-form expansion applied to it?

I suspect it gets mapped to 1.0.0.1 because no other resolution is possible. Any other locations for the two zeros results in an invalid IP (either starting or ending in 0).

Ending in 0 is valid; you can have 1.0.1.0/23 as an IP.

https://stackoverflow.com/a/14915309/

https://jodies.de/ipcalc?host=1.0.1.0&mask1=23&mask2=

Re: Shortest URLs on the Internet

#18
post #12
post #8

Earlier quoted context omitted.

Why does 1.1 resolve to 1.0.0.1? I don't recall this being in any of the documents about CIDRs. Are browsers implicitly mapping IPv4 addresses temporarily into IPv6 addresses during parsing, such that "1.1" becomes "1::1", and then gets IPv6 abbreviated-form expansion applied to it?

I'm also curious. Especially since curl 7.64.1 (Release-Date: 2019-03-27, on macOS) says: % curl 'http://1.1/' error code: 1003 while curl 7.85.0 (Release-Date: 2022-08-31, on FreeBSD) says: % curl 'http://1.1/' 301 Moved Permanently 301 Moved Permanently cloudflare

That is because their http:// site redirects to https://
Post reply on HN