http://184.11274826/ http://184.172.2634/
The rule here is that the last (but apparently only the last) numeric component may encode multiple bytes.
127.0.0.1 == 127.1
10.0.0.1 == 10.1
192.168.0.1 == 192.168.1
I never quite understood why they chose to reuse the colon as a separator character, because this is problematic when you want to append a port number. '2001::1:0:2:8080' could either be '2001:0:0:1:0:2 on port 8080', or '2001:0:1:0:2:8080 on the default port'. The following (ugly) syntax is used to resolve that ambiguity: [2001::1:0:2]:8080.
To test this out, first find a link-local address on your network. To find all link-local addresses on eth0, use this command to ping the all-nodes link-local multicast group:
ping6 -I eth0 -c 2 ff02::1
Now append the percent sign and zone index to the address and connect to the host on a port that is probably open. lynx https://[fe80::21e:67ff:fe08:d500%eth0]:443/Which system do you use that this works on?
I can't explain why.
0.0.0.0/8 - Addresses in this block refer to source hosts on "this"
network. Address 0.0.0.0/32 may be used as a source address for this
host on this network; other addresses within 0.0.0.0/8 may be used to
refer to specified hosts on this network.
Support for it looks to be flaky. 'ping 0' and 'ping 0.0.0.0' work for me on various Linuxes ("64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.026 ms"), but not on Windows 7 ("sendto: Cannot assign requested address") or Windows Server 2003 ("Destination specified is invalid").This is intriguing, really :)
EDIT: oh, you already pointed to the RFC :)
This small ruby script
#!/usr/bin/ruby
a, b, c, d = $*[0].split('.').map(&:to_i)
i = a * 256**3 + b * 256**2 + c * 256 + d
puts "dec: http://#{i}"
puts "hex: http://0x#{i.to_s(16)}"
puts "oct: http://0#{i.to_s(8)}"
..yields the following: % ip2dword 184.172.10.74
dec: http://3098282570
hex: http://0xb8ac0a4a
oct: http://027053005112Edit: I highly doubt that this is standard behavior. I suspect that implementations that permit this are storing the number in a 32 bit integer and not checking to see that it was truncated.
$ ping 7393249866
PING 7393249866 (184.172.10.74): 56 data bytes
64 bytes from 184.172.10.74: icmp_seq=0 ttl=47 time=259.042 ms $ uname -a
Linux GFMPC-056 3.11.2-1-ARCH #1 SMP PREEMPT Fri Sep 27 07:35:36 CEST 2013 x86_64 GNU/Linux4.2.2.1 or 0x04020201?
Mostly readability and speed of typing, I would think.
Does anyone know why Facebook does that?
http://[0:0:0:0:0:ffff:b8ac:a4a]
http://asdf:qwerty@3098282570/
http://asdf:qwerty@[0:0:0:0:0:ffff:b8ac:a4a]:80
(Might get a security/phishing warning on the last two links in some browsers.)
Here's some other encodings you can use for the same address, they're all valid and recognised by most browsers and other software:
http://3098282570/
http://7393249866/
http://0xb8.0xac.0x0a.0x4a/
http://0270.0254.0012.0112/
The source for this comment is an XSS filtering bypass tool by RSnake — http://ha.ckers.org/xsscalc.html