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(";")[1].lower() for line in lines] >>> file("tlds.txt", "w").writelines(tlds)
Which characters are allowed for second level domains?
RFC3696 says:
[...] 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 69.93.76.154 Host a.cn not found: 3(NXDOMAIN) a.cx has address 210.249.74.117 a.cc has address 63.251.164.134 Host a.co not found: 3(NXDOMAIN) Host a.km not found: 3(NXDOMAIN) a.cg has address 64.22.91.27 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 193.110.43.89 (www.camodo.de) 213.239.203.47 (213-239-203-47.clients.your-server.de) 217.72.199.72 (designer.mypage.web.de) 62.146.4.141 (web.keppler-it.de) 62.4.64.119 (webrouter0.de.nic.nu) 80.237.209.88 (ds80-237-209-88.dedicated.hosteurope.de) 81.169.173.209 (modulusdesign.de) 82.165.33.219 (a8server.de) 82.96.99.161 (s6.sconf.de) 89.110.156.30 (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()[1],line.split()[0]) for line in lines] >>> d=dict[t] >>> pingable=file("pingable-de.txt").readlines() >>> p = [line.split()[0] for line in pingable] >>> for i in p: ... print i, d[i] 193.110.43.89 5.ag 213.239.203.47 1.tf 217.72.199.72 7.ms 62.146.4.141 s.ki 62.4.64.119 9.nu 80.237.209.88 4.ro 81.169.173.209 o.pl 82.165.33.219 8.ag 82.96.99.161 g.cx 89.110.156.30 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 217.237.150.115 | grep "has address" | cut -d" " -f1,4 >> hosts-ip.txt; done $ cat hosts-ip.txt AI 209.88.68.34 IO 80.249.100.38 BI 196.2.8.205 CM 195.24.192.17 DK 193.163.102.10 IM 217.23.168.132 PH 203.119.4.7 PN 80.68.93.100 SH 64.251.31.234 WS 63.101.245.10 TM 80.249.100.37 UZ 195.158.1.25
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 [80.249.100.37] mit 32 Bytes Daten: Antwort von 80.249.100.37: Bytes=32 Zeit=88ms TTL=57 Antwort von 80.249.100.37: Bytes=32 Zeit=94ms TTL=57 Antwort von 80.249.100.37: Bytes=32 Zeit=93ms TTL=57 Antwort von 80.249.100.37: Bytes=32 Zeit=84ms TTL=57 Ping-Statistik für 80.249.100.37: 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:
ping .
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