I set up my hostname to a number, where running
But when I run
ping 6592, I get:
connect: Invalid argument
I checked the related Wikipedia page, and it does say that such a hostname is allowed (IIUC). What am I missing?
What the RFC says is actually immaterial here. The RFC specifies what goes on at the DNS level, but that's moot if ping doesn't make a DNS query in the first place. When ping receives an all-numeric argument, it interprets it as an IP address.
IPv4 addresses are technically 32-bit numbers. They are almost always written in dot-decimal notation, so-called “dotted quads” like
Addresses in the range 0.0.0.0/8 are reserved for use as source addresses in broadcasts. You can't send a packet to them, which is why
Many programs, including most ping implementations, have no option to force a DNS lookup. You would run into similar trouble if you made a local network with all-numeric subdomains, and ended up with a valid hostname that looked like a dotted quad.
If your local network has a name,
Well, not exactly... What Wikipedia, and in turn the RFCs say is that since the original RFC 952, which didn't allow leading numerics, you can now have them. ( Per RFC 1123 ) You still can't have all numeric though, which is your problem.
Your '6952' isn't a valid hostname, while '6952x' should be fine. But, RFCs aside, I've had problems within the last year or so with leading numerics. I'd avoid them, unless there's a compelling reason not to.