Earlier quoted context omitted.
You made a good point here: I recognised 127.0.0.1 in the value instantly, showing that you can sometimes read this representation by eye, e.g.: 0x0a000001 = 10.0.0.1 0xc0a80001 = 192.168.0.1
That's why i usually like to go with, http://0x7f123456/ same effect but less recognition.
This is a valid ipv4 address
91–100 of 101 posts
Re: This is a valid ipv4 address
#92Earlier quoted context omitted.
More weird formats (which at least work in chrome/mac, and the mac implementation of getaddrinfo()): 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.
I use this one all the time: 127.0.0.1 == 127.1 10.0.0.1 == 10.1 192.168.0.1 == 192.168.1
Re: This is a valid ipv4 address
#93Earlier quoted context omitted.
I wasn't aware of that shortcut, that's very useful.
It's especially useful for some IPv6 addresses.
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.
Re: This is a valid ipv4 address
#94Earlier quoted context omitted.
This is not true. 0.0.0.0 may end up at localhost for you, but it's not localhost. I just get: PING 0.0.0.0 (0.0.0.0): 56 data bytes ping: sendto: No route to host Which system do you use that this works on?
I don't know about the OP, but in Ubuntu Precise "ping 0" pings to 127.0.0.1. 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").Re: This is a valid ipv4 address
#95Earlier quoted context omitted.
I don't know about the OP, but in Ubuntu Precise "ping 0" pings to 127.0.0.1. I can't explain why.
From what I can tell, the use of '0' or '0.0.0.0' as a destination address is not official. It should only be used as a source address. From RFC 5735 - Special USe IPv4 Addresses: 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…
This is intriguing, really :)
EDIT: oh, you already pointed to the RFC :)
Re: This is a valid ipv4 address
#96The last time this came up on HN, I decided to dig into ping and glibc's resolver stuff to find out exactly why this worked. http://rachelbythebay.com/w/2012/10/13/ping/
Re: This is a valid ipv4 address
#97Re: This is a valid ipv4 address
#98The decoded URL for this submission is http://184.172.10.74/ — the server for Hacker News. 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.htm…
More encodings: 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.)
Re: This is a valid ipv4 address
#99Earlier quoted context omitted.
I use this one all the time: 127.0.0.1 == 127.1 10.0.0.1 == 10.1 192.168.0.1 == 192.168.1
I often use 0 == 0.0.0.0 == localhost
Re: This is a valid ipv4 address
#100Earlier quoted context omitted.
Funny. http://7393249866/ resolves to http://255.255.255.255/ in Opera (on linux), it appears to do saturating math for the overflow.
It works fine in my Opera 12.16 for Linux (amd64).
$ uname -a
Linux GFMPC-056 3.11.2-1-ARCH #1 SMP PREEMPT Fri Sep 27 07:35:36 CEST 2013 x86_64 GNU/Linux