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.
RFC 1912, documenting common DNS configuration errors, states:
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.
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."
In addition to the answers about RFC, an alternative solution would be to use
in the configuration for
example.com
. You end up with a FQDN1.fax.example.com
.