Re: [whatwg/url] http://40000000000 considered as being a wrong URL (#436)

I am still surprised that there is a discrepency between curl, ping, ssh... and the spec detailed in whatwg.

But the wrong behaviour seems to be the one used by curl, ping and ssh.

On Debian GNU/Linux 8.11 (jessie), ping:

```
user@server:~$ ping 12345678901
ping: unknown host 12345678901

user@server:~$ ping 10.123456789
ping: unknown host 10.123456789

user@server:~$ ping 1234567890
PING 1234567890 (73.150.2.210) 56(84) bytes of data.
^C
--- 1234567890 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms

user@server:~$ ping 10.12345678
PING 10.12345678 (10.188.97.78) 56(84) bytes of data.
^C
--- 10.12345678 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms
```

On Debian GNU/Linux 8.11 (jessie), curl:

```
user@server:~$ curl -v http://12345678901
* Rebuilt URL to: http://12345678901/
* Hostname was NOT found in DNS cache
* Could not resolve host: 12345678901
* Closing connection 0
curl: (6) Could not resolve host: 12345678901

user@server:~$ curl -v http://1234567890
* Rebuilt URL to: http://1234567890/
* Hostname was NOT found in DNS cache
*   Trying 73.150.2.210...
```

On Debian GNU/Linux 8.11 (jessie), ssh:

```
user@server:~$ ssh -v p@12345678901
OpenSSH_6.7p1 Debian-5+deb8u7, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
ssh: Could not resolve hostname 12345678901: Name or service not known

user@server:~$ ssh -v p@1234567890
OpenSSH_6.7p1 Debian-5+deb8u7, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 1234567890 [73.150.2.210] port 22.
```

Same on Windows 10 for ping and curl (using CMD).

The remark stated in the RFC is:
> However, a valid host name can never have the dotted-decimal form #.#.#.#, since at least the highest-level component label will be alphabetic.

For me it means that 10000.333.222.111111 is clearly considered to be invalid.
It also confirms your statement: the latest label must at least have one alphabetic character (or at least I understand that).


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/436#issuecomment-480351489

Received on Friday, 5 April 2019 17:09:05 UTC