It's probably unwise to use a number as a host name, but I do at times and most 
things work just fine. RFC 1123 OK's this practice and notes that host software 
*must* support host names that begin with digits (3com.com, etc). I have a host 
named 700.nnn.com and I can ping it by FQDN or by its IP address, but I cannot 
simply ping 700 (even tho that entry is in /etc/hosts). In the first and second 
tests below, ping treats the host arg as an int, in the third as a string.

# ping 700
PING 700 (0.0.2.188): 56 data bytes

# ping 3232235785
PING 3232235785 (192.168.1.9): 56 data bytes
64 bytes from 192.168.1.9: icmp_seq=0 ttl=255 time=0.038 ms
64 bytes from 192.168.1.9: icmp_seq=1 ttl=255 time=0.031 ms
64 bytes from 192.168.1.9: icmp_seq=2 ttl=255 time=0.030 ms

# ping 700.nnn.com
PING 700.nnn.com (192.168.1.9): 56 data bytes
64 bytes from 192.168.1.9: icmp_seq=0 ttl=255 time=0.036 ms
64 bytes from 192.168.1.9: icmp_seq=1 ttl=255 time=0.027 ms

Since ping takes either an int or a string as a host name arg, it would be neat 
if a flag could be passed that forces ping to treat the host argument as a 
string rather than an int for nuts like me who use numbers for names. I tried 
quoting the name "700" but no go. I began looking at the source code, but 
stopped and decided to post to tech. There may be good reason for not doing 
this, I don't know. It's just an oddity I came across and thought I would 
mention it.

Brad

Reply via email to