Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do these URLs without a TLD resolve to a webpage?

Tags:

url

tld

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

like image 553
kevinsa5 Avatar asked Oct 01 '14 23:10

kevinsa5


People also ask

What is the purpose of TLD?

Also known as domain extensions, TLDs serve to recognize certain elements of a website, such as its purpose, owner or geographical area. For example, a . edu top-level domain allows users to immediately identify that site as a higher educational institution.

What is a TLD URL?

A TLD (top-level domain) is the most generic domain in the Internet's hierarchical DNS (domain name system). A TLD is the final component of a domain name, for example, "org" in developer.mozilla.org .

Does a URL need a top-level domain?

Aside from being a part of a website URL, the top-level domain is the highest level in the internet's hierarchical Domain Name System (DNS). As such, it is highly important not only for a website to function but also to appear legitimate to potential visitors.

Why do some websites not work without www?

So Why Doesn't My Website Work Without www? Your website doesn't work without www because either the domain records are incomplete or your website hasn't been configured to forward people to the correct place.


2 Answers

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?

like image 76
unor Avatar answered Sep 26 '22 00:09

unor


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.

like image 32
kaqqao Avatar answered Sep 22 '22 00:09

kaqqao