Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

www1                    A       1.2.3.4
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?

EDIT

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      1.2.3.4
...

However, when I use the Google DNS server (8.8.8.8), 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

;; QUESTION SECTION:
;1.example.com.         IN  A

;; AUTHORITY SECTION:
example.com.        1205    IN  SOA root.example.com. admin.example.com. 5 3600 600 43200 3600

;; Query time: 112 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; 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

;; QUESTION SECTION:
;83592583.qzone.qq.com.     IN  A

;; ANSWER SECTION:
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   60.254.175.65
a1574.b.akamai.net. 18  IN  A   60.254.175.64

;; Query time: 328 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; 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 @8.8.8.8 1.example.com, (neither 8.8.4.4), 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 1.somedomain.com.? –  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
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 '11 at 1:45
add comment

3 Answers

up vote 10 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., 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.

share|improve this answer
    
In bind 9, the configuration option is check-names. –  grawity May 1 '11 at 12:44
add comment

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
3  
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
add comment

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

1.fax IN A 1.2.3.4

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

share|improve this answer
add comment

Your Answer

 
discard

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.