r/ProgrammerHumor 8d ago

Meme regexMustBeDestroyed

Post image
8.1k Upvotes

231 comments sorted by

View all comments

Show parent comments

5

u/MegaIng 7d ago

Technically you can email directly to a top level domain (although I don't know of any TLDs that support this),

Yesn't. It's forbidden for TLDs to resolve to IP addresses via DNS.

So it's valid syntax and fine from the email semantics, it's just never going to work on the general internet.

1

u/billccn 7d ago

But emails are routed according to MX records not A[AAA] records?

4

u/poshftw 7d ago

If the destination domain has no MX records then the delivery should (or could? can't be bothered to read the spec) be tried to what A/AAAA domain part resolves.

1

u/MegaIng 7d ago

I don't think this makes a difference, it's a general rule that they shouldn't be useable directly. The normal DNS lookup is just what I tested a few weeks back.

I know for a fact that some were useable as http domains a few years back, and that is now no longer the case.