I want to setup an DNS record which contains only digits, for example:

www1                    A
1                       CNAME   www1

However, the pure number seems not work.

I know some sites which use integer in their host names, something like 400.5432.somefax.com, so I guess maybe I should escape the numbers?


It seems BIND do support labels of pure numbers:

$ dig @localhost 1.example.com
1.example.com.     43200  IN  CNAME  www1.example.com.
www1.example.com.  43200  IN  A

However, when I use the Google DNS server (, it's failed.

; <<>> DiG 9.7.3 <<>> 1.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 20866
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;1.example.com.         IN  A

example.com.        1205    IN  SOA root.example.com. admin.example.com. 5 3600 600 43200 3600

;; Query time: 112 msec
;; WHEN: Tue May  3 19:09:39 2011
;; MSG SIZE  rcvd: 94

However, Google DNS server should be no problem with number labels, because it can resolve, for example, 83592583.qzone.qq.com:

; <<>> DiG 9.7.3 <<>> 83592583.qzone.qq.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18687
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0

;83592583.qzone.qq.com.     IN  A

83592583.qzone.qq.com.  600 IN  CNAME   qq.com.edgesuite.net.
qq.com.edgesuite.net.   9439    IN  CNAME   a1574.b.akamai.net.
a1574.b.akamai.net. 18  IN  A
a1574.b.akamai.net. 18  IN  A

;; Query time: 328 msec
;; WHEN: Tue May  3 19:12:10 2011
;; MSG SIZE  rcvd: 134

So, BIND9 is okay, Google DNS is okay, my zone config is okay, I can dig @localhost 1.example.com which gives the correct answer. But I can't dig @ 1.example.com, (neither, Now I stuck.

  • Can you share the logs from when you load the zone? Can you dig for www1 successfully?
    – Cakemox
    Apr 30, 2011 at 13:42
  • What DNS server are you using? I was able to load a similar zone in a BIND installation. As a workaround, can you try the FQDN in the first field? i.e., instead of 1, use 1.somedomain.com.?
    – BMDan
    Apr 30, 2011 at 15:01
  • @BMDan: It's BIND 9.7.3. I found the DNS server is okay, I've updated the question, thanks in advance.
    – Lenik
    May 3, 2011 at 11:21
  • @Cakemox: Everything happy with www1.
    – Lenik
    May 3, 2011 at 11:23
  • 1
    What about dig +trace 1.example.com? Then check each DNS server that's listed by the TLD servers as being authoritative. Your goal is to find the address associated with 1.example.com the same way Google's DNS server does. All else being equal, it's most likely a problem with your server(s), not Google's.
    – BMDan
    May 4, 2011 at 1:45

3 Answers 3


RFC 1912, documenting common DNS configuration errors, states:

Allowable characters in a label for a host name are only ASCII letters, digits, and the `-' character. Labels may not be all numbers, but may have a leading digit (e.g., 3com.com). Labels must end and begin only with a letter or digit. See [RFC 1035] and [RFC 1123]. (Labels were initially restricted in [RFC 1035] to start with a letter, and some older hosts still reportedly have problems with the relaxation in [RFC 1123].) Note there are some Internet hostnames which violate this rule (411.org, 1776.com). The presence of underscores in a label is allowed in [RFC 1033], except [RFC 1033] is informational only and was not defining a standard. There is at least one popular TCP/IP implementation which currently refuses to talk to hosts named with underscores in them.

Label is equivalent to hostname for your question.

RFC1912 is informational, not setting a standard. In the way of informational RFCs, some DNS implementations took it as gospel and therefore don't work with all numbers. Which is another way of saying, for maximum compatibility with the entire Internet, put at least one letter in your hostnames.

Obviously it can work (heck, the RFC cites examples!), so the trick is convincing your DNS server to allow it. And for that, I'll have to defer to other users.

  • In bind 9, the configuration option is check-names. May 1, 2011 at 12:44

Just having a number as a host name is not permitted, from rfc1035:

"The labels must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen. There are also some restrictions on the length. Labels must be 63 characters or less."

  • 4
    RFC 1123 section 2.1 says "The syntax of a legal Internet host name was specified in RFC-952 [DNS:4]. 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."
    – user9517
    Apr 30, 2011 at 14:05
  • 1
    Thanks, I stand corrected. Personally I still wouldn't do it tho'.
    – blankabout
    Apr 30, 2011 at 14:35

In addition to the answers about RFC, an alternative solution would be to use

1.fax IN A

in the configuration for example.com. You end up with a FQDN 1.fax.example.com.

You must log in to answer this question.

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