3 ms·
Why is it 253 and not 255 characters ? It's killing my OCD.
by marto1 5y ago
Why is it 253 and not 255 characters ? It's killing my OCD.
- weitzj 5y agoRandom guess: Maybe because domains normally end with a dot, i.e. google.com. and maybe some termination character NULL string? 253+ 1+ 1 ?
- mimimi31 5y agoThe domain name is transmitted as a sequence of labels plus one byte for each label's length, followed by a null byte for the root label. Everything together must fit into 255 bytes. So the domain name x.y.z (technically x.y.z. with the empty space after the last dot representing the root label) uses the following bytes: [length of x][x][length of y][y][length of z][z][length of root label, i.e. 0] Since we usually add dots to visually separate labels, you can imagine the dots and inner length bytes cancelling each other out, leaving the first length byte and the last null byte as the two "missing" bytes.