Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Longest Possible Domain Name (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz...)
26 points by phil294 on July 31, 2021 | hide | past | favorite | 19 comments


Full domain name (since my phone and HN seem to elide it in places):

a.b.c.d.e.f.g.h.i.j.k.l.m.n.oo.pp.qqq.rrrr.ssssss.tttttttt.uuuuuuuuuuu.vvvvvvvvvvvvvvv.wwwwwwwwwwwwwwwwwwwwww.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy.zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.me


I'm on desktop and HN still crops the domain name. Here it is with spaces added to it wraps:

http://a.b.c.d.e.f.g. h.i.j.k.l.m.n.oo.pp. qqq.rrrr.ssssss.tttttttt.uuuuuuuuuuu. vvvvvvvvvvvvvvv.wwwwwwwwwwwwwwwwwwwwww. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy. zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.me


if you use a TLD like ".motorcycles" , you could probably make it even longer


There's a maximum limit of ~250 bytes for a DNS name.

See https://stackoverflow.com/questions/32290167/what-is-the-max... for more information.

Using a longer TLD won't change the maximum length.


Unfortunately, the blog post linked to is now a 404. Here's an archived version: https://web.archive.org/web/20180202204836/http://blog.sacal...


In the same idea I set this up a while ago, no use of sub domains though haha: https://1111111111111111111111111111111111111111111111111111...


Why is it 253 and not 255 characters ? It's killing my OCD.


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


Random guess: Maybe because domains normally end with a dot, i.e. google.com. and maybe some termination character NULL string? 253+ 1+ 1 ?


By number of characters maybe, but there are longer characters.


Thanks for screwing up the hckrnews interface for the next 24 hours.


I was wondering why hckrnews.com was rendering poorly on Safari (iOS). Your comment helped connect the dots.

Funny side effect!


Gash darn it ! :(


Or: thanks for revealing a possible improvement on hckrnews ;)


Not very long, as z is a pretty short character.


depends on your font, in monospace it's equally long as any other letter.


Please add Let's Encrypt, make it secure!


Amusingly, there's a backward compatibility issue where the first name on a Let's Encrypt certificate can only be, at most, 63 characters long (because it gets represented in the CN field, which is limited this way). All of the other names get represented only in SAN extensions, which don't have the same limit.

So, if you need a Let's Encrypt certificate for a name over 63 characters in length, you have to also put another name on that certificate that is shorter, so Let's Encrypt has something to put in the CN field.


that is a long name.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: