Dirk Loss - 2007-01-26
Some hosts on the Internet have really short names. Those hosts are useful if you like to test your Internet connection and do not want to type much:
$ ping 2.am $ ping n.nu
I had found those two domains by chance. But then I wanted a more complete view and pondered some questions:
You can see what I did below. If you are just interested in the results, please take a look at the list of three-letter domains or download the whole collection of files I generated.
If you are interestend in long domain names, please look here, here and here. And don't forget Jimmy Juice, a really cool funk and soul band who once presented their domain name ( which is their real band name) on stage, printed on a big roll of wall paper. Great show!
First we need a list of top level domains. Googling for "top level domains" leads to a nice Wikipedia article. Looking at the list makes clear that only the country-code top level domains, which all consist of only two characters, are relevant. Because all generic top- level domains (.com, .org, .info, ...) have at least three characters.
So we have to search for a list of country-code top level domains (ISO 3166-1-alpha-2). Just google for "3166-1-alpha-2 filetype:txt" and download the following file:
$ wget http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1-semic.txt
$ head list-en1-semic.txt This list states the country names (official short names in English) in alphabetical order as given in ISO 3166-1 and the corresponding ISO 3166-1-alpha-2 codeelements. The list is updated whenever a change to the official code list in ISO 3166-1 is effected by the ISO 3166/MA. It lists 240 official short names and code elements. One line of text contains one entry. A country name and its code element are separated by a semicolon (;). AFGHANISTAN;AF ALAND ISLANDS;AX ALBANIA;AL ALGERIA;DZ AMERICAN SAMOA;AS ANDORRA;AD
Now the header and the empty line can be deleted by using
sed -i~ '1,2d' list-en1-semic.txt
We now have a list of 244 country-code top level domains:
$ wc -l list-en1-semic.txt 244 list-en1-semic.txt
I use Python to extract the domain codes from the file:
$ python >>> lines = file("list-en1-semic.txt", "rU").readlines() >>> tlds = [line.split(";").lower() for line in lines] >>> file("tlds.txt", "w").writelines(tlds)
Which characters are allowed for second level domains?
[...] the labels (words or strings separated by periods) that make up a domain
name must consist of only the ASCII [ASCII] alphabetic and numeric characters,
plus the hyphen. No other symbols or punctuation characters are permitted, nor
is blank space. If the hyphen is used, it is not permitted to appear at
either the beginning or end of a label.
Because we are only interested in 1-character second-level domains, the hyphen is not allowed. So there's no "-.de" domain.
$ python >>> import string as st >>> s = st.ascii_lowercase+st.digits >>> tlds = file("tlds.txt").readlines() >>> names = ["%s.%s" % (left,right) for left in s for right in tlds] >>> file("candidates.txt", "w").writelines(names)
Now we have a list of 244*36 = 8784 potential three-letter domain names:
$ head -5 candidates.txt a.af a.ax a.al a.dz a.as $ wc -l candidates.txt 8784 candidates.txt
Ok, let's resolve these names to IP adresses, in order to see which ones are active. There is no real need for sophisticated multi-threading here, because even if we can do only 5 DNS lookups per second, we'll be finished in half an hour. I think that's acceptable.
$ for h in $(cat candidates.txt);do host -t A >> result.txt done $ cat result.txt [...] Host a.td not found: 3(NXDOMAIN) a.cl has address 188.8.131.52 Host a.cn not found: 3(NXDOMAIN) a.cx has address 184.108.40.206 a.cc has address 220.127.116.11 Host a.co not found: 3(NXDOMAIN) Host a.km not found: 3(NXDOMAIN) a.cg has address 18.104.22.168 Host a.cd not found: 3(NXDOMAIN) [...]
Taking only those with an A record gives us to a list of 1431 really short domain names:
$ grep "^.\... has address" result.txt | cut -d' ' -f1 | sort -u | sort -t. --key=2,3 > shortdomains.txt $ head -5 shortdomains.txt 0.ag 1.ag 2.ag 3.ag 5.ag $ wc -l shortdomains.txt 1431 shortdomains.txt
So almost a sixth of all 8784 potential 3-letter names really exist. These short domain names are not so rare as I thought...
Now let's look for sites with a cool name:
$ less shortdomains.txt
I found the following ones quite nice:
And personally I think that g.gg is the one that is most easily typed when pinging:
$ ping g.gg
Not all registrars allow one-letter second level domains? In Germany, not even two-letter second level domains are allowed. So let's look in which countries you can get really short domain names:
$ cut -d'.' -f2 shortdomains.txt | sort | uniq > registrars.txt $ head -5 registrars.txt ag ai am bb bm bw bz cc cg cl $ wc -l registrars.txt 64
So next time we will only ask those registrars...
Which domains point to hosts answering ICMP echo requests? We'll use Nmap ping scans for this:
$ nmap -sP -v -PE -iL shortdomains.txt -oG pinged.txt [...] Nmap finished: 1430 IP addresses (1079 hosts up) scanned in 525.023 seconds Raw packets sent: 2104 (58.912KB) | Rcvd: 1079 (49.644KB)
(Of course we could just scan the IP addresses and afterwards look in our result.txt file to find the corresponding domains. Would have been faster but slightly more work.)
Now, let's check which ones are up:
# grep "Status: Up" pinged.txt | sort -u | cut -d" " -f2,3 | cut -f1 > pingable.txt
We produce a nice list of ip domain pairs:
$ grep "has address" result.txt | cut -d' ' -f1,4 > host-ips.txt
Finally, which ones are likely to have low round-trip times (from my location in Germany)? For a quick start, let's just take those with a reverse-lookup'ed hostname in .de.
$ grep "\.de" pingable.txt > pingable-de.txt $ cat pingable-de.txt 22.214.171.124 (www.camodo.de) 126.96.36.199 (213-239-203-47.clients.your-server.de) 188.8.131.52 (designer.mypage.web.de) 184.108.40.206 (web.keppler-it.de) 220.127.116.11 (webrouter0.de.nic.nu) 18.104.22.168 (ds80-237-209-88.dedicated.hosteurope.de) 22.214.171.124 (modulusdesign.de) 126.96.36.199 (a8server.de) 188.8.131.52 (s6.sconf.de) 184.108.40.206 (ffm.de.eunoc.net)
I use Python again to lookup the short domains for those IP addresses:
$ python >>> lines=file("host-ips.txt").readlines() >>> t=[(line.split(),line.split()) for line in lines] >>> d=dict[t] >>> pingable=file("pingable-de.txt").readlines() >>> p = [line.split() for line in pingable] >>> for i in p: ... print i, d[i] 220.127.116.11 5.ag 18.104.22.168 1.tf 22.214.171.124 7.ms 126.96.36.199 s.ki 188.8.131.52 9.nu 184.108.40.206 4.ro 220.127.116.11 o.pl 18.104.22.168 8.ag 22.214.171.124 g.cx 126.96.36.199 p.ro
Manually pinging those hosts shows several ones with low round-trip times.
Personally I will probably choose p.ro in the future if I need a fast response.
Added on 2007-01-28
I found out that there are even shorter domain names with hosts answering a Ping than those I described below:
$ wget http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1-semic.txt $ sed -e "1,2d" list-en1-semic.txt | cut -d";" -f2 > tlds.txt $ for t in $(cat tlds.txt); do host -t A $t 188.8.131.52 | grep "has address" | cut -d" " -f1,4 >> hosts-ip.txt; done $ cat hosts-ip.txt AI 184.108.40.206 IO 220.127.116.11 BI 18.104.22.168 CM 22.214.171.124 DK 126.96.36.199 IM 188.8.131.52 PH 184.108.40.206 PN 220.127.116.11 SH 18.104.22.168 WS 22.214.171.124 TM 126.96.36.199 UZ 188.8.131.52
The following hosts answer Pings: AI, BI, IM, IO, PN, SH, TM and UZ. Under Windows you will have to add a trailing dot to the domain name to avoid having your local domain name added autmatically:
c:\>ping tm. Ping tm [184.108.40.206] mit 32 Bytes Daten: Antwort von 220.127.116.11: Bytes=32 Zeit=88ms TTL=57 Antwort von 18.104.22.168: Bytes=32 Zeit=94ms TTL=57 Antwort von 22.214.171.124: Bytes=32 Zeit=93ms TTL=57 Antwort von 126.96.36.199: Bytes=32 Zeit=84ms TTL=57 Ping-Statistik für 188.8.131.52: Pakete: Gesendet = 4, Empfangen = 4, Verloren = 0 (0% Verlust), Ca. Zeitangaben in Millisek.: Minimum = 84ms, Maximum = 94ms, Mittelwert = 89ms
Moreover, the following hosts are reachable via http: AI, BI., IM, IO, PN, TM, UZ.
And if you use OpenDNS as a nameserver (IMHO not such a good idea), you can even try the following expression:
Apparently, these short domain names / host names will not work with some Windows DNS servers. If you do have problems, please try the slightly longer ones below or use a Web based DNS lookup service.© 2007 Dirk Loss - Last Changed: 2007-07-07