7

Is a FQDN valid if the hostname component is entirely numeric? It's not something I've come across before and I'm not sure if something like the following is legal:

001.example.com.

I know it's an issue for Windows Servers, but is a purely numeric hostname (001 in this case) ever an issue for *nix servers?

2 Answers 2

8

It is legal in form 001.example.com, you can add a hostname 001 as a record on DNS server and you will be able to ping and work with 001.example.com, I'm not sure if any *nix service will fail to work with that, it is according to standards and they should all support it, but you will have problems when omitting the domain.

$ ping 001.example.com

Pinging 001.example.com [127.0.0.5] with 32 bytes of data:

For instance ping, traceroute and many other tools will for 001 return an IP representation of the decimal number, which in this case is 0.0.0.1

$ ping 001

Pinging 0.0.0.1 with 32 bytes of data: PING: transmit failed. General failure. PING: transmit failed. General failure. PING: transmit failed. General failure. PING: transmit failed. General failure.


Highest number you can go that way is 30064771070 which represents 255.255.255.254


ping 30064771070

Pinging 255.255.255.254 with 32 bytes of data:


$ ping 30064771071 Ping request could not find host 30064771071. Please check the name and try again.


For number 30064771071 it will fail as it represents 255.255.255.255, and for numbers 30064771072 and higher it will resolve to IP if the hostname exists, for smaller numbers it always tries IP representation of the decimal number


$ ping 30064771072

Pinging 30064771072 [127.0.0.4] with 32 bytes of data: Reply from 127.0.0.4: bytes=32 time<1ms TTL=128 Reply from 127.0.0.4: bytes=32 time<1ms TTL=128

There was a similar question on UNIX SE

3

No issue at all, it is just common to use more relevant/logical names and preferably letters for hostname

See:

https://www.rfc-editor.org/rfc/rfc1035

http://kb.iu.edu/data/aiuv.html

Hope this helps

2
  • RFC 1035 outright states that 001 is not valid, as labels should always start with an ASCII letter. Oct 12, 2013 at 12:32
  • 5
    it was changed in rfc1123 tools.ietf.org/html/rfc1123#page-13 One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit. Host software MUST support this more liberal syntax.
    – ralz
    Oct 12, 2013 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .