Reputation: 3411
I noticed that the URL ga resolves to a website, but without a TLD like .com, .org, etc. I wrote a script to test all the two-letter URLs:
#!/bin/bash
for a in {a..z}
do
for b in {a..z}
do
curl "$a$b" -s -m 10 >> foo.txt
if [ -s foo.txt ]
then
cp foo.txt "$a$b.txt"
rm foo.txt
echo "$a$b"
fi
done
done
which prints
ai
dk
pn
to
uz
The script isn't perfect (it doesn't recognize ga
, for instance), but it shows that there are several more of these URLs. I did notice that these URLs are all TLDs in their own right-- ai is Anguilla, dk is Denmark, etc. Why are these URLs "valid" in the sense that they resolve to an IP address, and why do they exist?
(I'd make these into clickable links, but funnily enough, the SO formatter won't accept them as valid.)
Upvotes: 13
Views: 9089
Reputation: 96717
They don’t have a TLD, they are TLDs.
If you control a top-level domain, you can add DNS resource records for the TLD itself as well as any of its subdomains (which would be second-level domains, or typically called domains), and of the subdomains of the second-level domains (i.e., third-level domains), and so on.
While it’s not so common, some TLD owners make the TLD resolvable (e.g. the to
TLD: http://to/
or, if your browser {or Stack Overflow’s editor ;)} has problems with it, as FQDN: http://to./).
Related question on Server Fault: How the heck is http://to./ a valid domain name?
Upvotes: 15
Reputation: 15479
I think just like a subdomain (i.e. subdomain.domain.com) is not strictly required to make the URL resolvable, the domain itself isn't required either, as it is just a subdomain of a TLD. It's just that actually registering a TLD with an IP directly isn't a common practice.
Upvotes: 1