Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, so I guess maybe I should escape the numbers?


It seems BIND do support labels of pure numbers:

$ dig @localhost
...     43200  IN  CNAME  43200  IN  A

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

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

;         IN  A

;; AUTHORITY SECTION:        1205    IN  SOA 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,

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

;     IN  A

;; ANSWER SECTION:  600 IN  CNAME   9439    IN  CNAME 18  IN  A 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 which gives the correct answer. But I can't dig @, (neither, Now I stuck.

share|improve this question
Can you share the logs from when you load the zone? Can you dig for www1 successfully? – Cakemox Apr 30 '11 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 – BMDan Apr 30 '11 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. – Xiè Jìléi May 3 '11 at 11:21
@Cakemox: Everything happy with www1. – Xiè Jìléi May 3 '11 at 11:23
What about dig +trace Then check each DNS server that's listed by the TLD servers as being authoritative. Your goal is to find the address associated with 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 '11 at 1:45
up vote 12 down vote accepted

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., 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 (, 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.

share|improve this answer
In bind 9, the configuration option is check-names. – grawity May 1 '11 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."

share|improve this answer
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." – Iain Apr 30 '11 at 14:05
Thanks, I stand corrected. Personally I still wouldn't do it tho'. – blankabout Apr 30 '11 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 You end up with a FQDN

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.