I was wondering if you could set a DNS (A type) that points a top-level domain to an IP address (e.g.
https://com points to an 220.127.116.11). Is this possible?
Yes and no.
In the structure of the DNS hierachy there is nothing preventing this behaviour - however in order to do it you need control over the tld.
You can do this in a hosts file if you run your own dns, but you cant do it globally for .com as you dont own it. If you have a lot of money you could get a vanity tld and do this for that tld.
Thinking of this there is one common place this fairly universally happens - but not through DNS - "localhost" is typically bound to 127.0.0.1 using a hosts file.
It is possible (if you control the TLD obviously), and it exists, but only in non ICANN controlled TLDs, which are gTLDs.
For gTLDs, ICANN - to block any new instance of the past SiteFinder issue - disallows records that are basically not
AAAA only for glues needed, and related maintenance ones (DNSSEC). In theory that would even prohibit generic
In ccTLDs, everything is possible, because technically an
A record at apex is nothing special.
I touched it already at my own answer at https://stackoverflow.com/a/49022087/6368697
but in short:
- it exists,
https://dk/being a widely known example that does not seem to work anymore right now, but you can try
https://ai/for example because
dig ai. A +shortreturns
- Wikipedia has a list of other examples (I need to find it again)
- See RFC 7085 "Top-Level Domains That Are Already Dotless" (December 2013) for a listing of all "dotless" cases (at that time), such as .DK, but they were 15 more. And even more if you count replies for
- SAC-053 from ICANN gives the reasoning against "dotless" domains (explaining they may fail to work because of broken applications/configurations basically)
- ICANN contracts with registry at https://newgtlds.icann.org/sites/default/files/agreements/agreement-approved-31jul17-en.html#exhibitA.1 specifically list which records and content can appear at apex; note how
AAAAare missing from the list except indirectly with the mention of "glues"