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 22.214.171.124 Host a.cn not found: 3(NXDOMAIN) a.cx has address 126.96.36.199 a.cc has address 188.8.131.52 Host a.co not found: 3(NXDOMAIN) Host a.km not found: 3(NXDOMAIN) a.cg has address 184.108.40.206 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 220.127.116.11 (www.camodo.de) 18.104.22.168 (213-239-203-47.clients.your-server.de) 22.214.171.124 (designer.mypage.web.de) 126.96.36.199 (web.keppler-it.de) 188.8.131.52 (webrouter0.de.nic.nu) 184.108.40.206 (ds80-237-209-88.dedicated.hosteurope.de) 220.127.116.11 (modulusdesign.de) 18.104.22.168 (a8server.de) 22.214.171.124 (s6.sconf.de) 126.96.36.199 (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] 188.8.131.52 5.ag 184.108.40.206 1.tf 220.127.116.11 7.ms 18.104.22.168 s.ki 22.214.171.124 9.nu 126.96.36.199 4.ro 188.8.131.52 o.pl 184.108.40.206 8.ag 220.127.116.11 g.cx 18.104.22.168 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 22.214.171.124 | grep "has address" | cut -d" " -f1,4 >> hosts-ip.txt; done $ cat hosts-ip.txt AI 126.96.36.199 IO 188.8.131.52 BI 184.108.40.206 CM 220.127.116.11 DK 18.104.22.168 IM 22.214.171.124 PH 126.96.36.199 PN 188.8.131.52 SH 184.108.40.206 WS 220.127.116.11 TM 18.104.22.168 UZ 22.214.171.124
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 [126.96.36.199] mit 32 Bytes Daten: Antwort von 188.8.131.52: Bytes=32 Zeit=88ms TTL=57 Antwort von 184.108.40.206: Bytes=32 Zeit=94ms TTL=57 Antwort von 220.127.116.11: Bytes=32 Zeit=93ms TTL=57 Antwort von 18.104.22.168: Bytes=32 Zeit=84ms TTL=57 Ping-Statistik für 22.214.171.124: 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