-2

Can a www.subdomain.host.com, A record work in the DNS entry? I have never seen it before. It seems to be a double subdomain.

rlaiacona
  • 3
  • 1

1 Answers1

0

If I understand RFC 1035, the total limit is 255 characters, but there are two characters we can discount, so the total limit can be said to be 253 characters. The characters will include each ., so the total limit on the number of subdomains includes how many of each . are used when adding up the total number of characters. Also, there is a limit on the character length of a label (subdomain) of 63 characters.

RFC 1035

2.3.4. Size limits

Various objects and parameters in the DNS have size limits. They are listed below. Some could be easily changed, others are more fundamental.

labels 63 octets or less

names 255 octets or less

TTL positive values of a signed 32 bit number.

UDP messages 512 octets or less

Paul
  • 2,755
  • 6
  • 24
  • 35
  • "The characters will include each ." It is a little more complicated than that and the limit is in bytes - or octets - , not characters (because otherwise you have the difficult discussion about how you encode characters into bytes, the DNS is encoding-agnostic). The limit of 255 applies in fact to the name as encoded in the DNS packet by DNS rules, which is complicated, as it is a sequence of label length then label content then a final byte of value 0. Taking all of that put the actual limit at 253, but even less if you have more labels (because each label takes one byte to store its length) – Patrick Mevzek Nov 10 '21 at 17:54
  • @PatrickMevzek If you would like to make an edit, that would be great, but given that I quoted the RFC, your comment doesn't seem clear to me, particularly the part stating that the total limit is less when taking into account `.`, which I accounted for in my explanation section. Keep in mind my goal is to provide an answer the user can understand, rather than just throwing a link to a 2000 line RFC at them. – Paul Nov 10 '21 at 18:19
  • "but given that I quoted the RFC" There are many RFCs on the DNS :-). See my comment on the question, I recommend you use RFC8499 as base as it is more recent. And it says this: "A domain name in the global DNS has a maximum total length of 255 octets in the wire format; the root represents one octet for this calculation.". The character `.` (dot) does not appear in DNS packets when names are exchanged (wire format) but the names are written as one byte for length of label then the label, repeated for each label left to right, and a final 00 byte denoting root/end of name. – Patrick Mevzek Nov 10 '21 at 20:54