π and the digital land rush.

graph of number of digits on the x axis and date registered on the y axis

A second-level domain name can be up to 63 characters long. If 3 is used as a sub-domain, and .com is the top-level domain, then http://3.141592653589793238462643383279502884197169399375105820974944592.com is the most digits of π that fit into a domain name. That domain name was registered in 2002. The next few shorter domains are also registered; the biggest unclaimed territory lies at 57 digits1. What about the rest of the domains in-between? And what about 314.com (no decimal place after the 3) and its series? And e? And the digits?

As you might guess from the graph2 at the top of this post, I’ve checked. I checked both versions of π, both versions of e, and all of the digits from 1 to 9. In the chart above, the smaller π and e indicate the inferior versions. I’ve ignored 0, for obvious reasons. You can see, for example, that 5555555.com was registered in mid-1996; that everything between 11111111111111.com and 111111111111111111.com was claimed in 2001, and that the maximum e was registered in 2010.

Here’s a table of the same information:

color-coded table showing when each domain name was registered

You can see that an absurd number of these are in fact registered. But 8 is the only fully claimed digit, presumably because it’s a lucky number in several Asian cultures. All of the single-digit domains were claimed at the opening of .com, but it took two decades for the land rush effect to fully reach the edge, and many gaps remain.

Here’s python code if you want to reproduce the results.

import re
import subprocess


def digits_generator():
    result = []
    for x in range(1, 10):
        for y in range(1, 64):
            domain = str(x) * y
            result.append((x, y, domain))
    return result


def irrationals_generator():
    result = []
    digit_list = ["1415926535897932384626433832795028841971693993751058209749445923",
                  "3141592653589793238462643383279502884197169399375105820974944592",
                  "7182818284590452353602874713526624977572470936999595749669676277",
                  "2718281828459045235360287471352662497757247093699959574966967627"]
    for x in digit_list:
        for y in range(0, 63):
            domain = x[0:y]
            result.append((x, y, domain))
    return result


def lookup(x, y, domain):
	# Determine the creation date of a specified domain, and print
	# a line of CSV-formatted report.
	#
    # The target line from WHOIS is 
    #     Creation Date: 1997-03-12T05:00:00Z

    try:
        command = 'whois {0}.com | grep "Creation Date"'.format(domain)
        result = subprocess.check_output(command, shell=True)
    except subprocess.CalledProcessError as E:
        print('{0}, {1}, {2}'.format(x, y, E))
        return

    # if it doesn't fail, the command may return one or more matching rows,
    # which may be byte or string.  handle both.
    try:
        first_date = result.split(b'\n', 1)[0]
    except TypeError:
        first_date = result.split('\n', 1)[0]
    try:
        parsed_date = re.search('Date: (.*Z)', str(first_date)).group(1)
        print('{0}, {1}, {2}'.format(x, y, parsed_date))
        return
    except Exception as E:
        print('{0}, {1}, {2}'.format(x, y, E))
        return


def main():
	# Print a CSV file of the registration date of various domains
	# column 1: the rational or irrational number being queried
	# column 2: number of digits in this query
	# column 3: creation date, or error text or blank if none.

    numbers = irrationals_generator()
    for thing in numbers:
        lookup(thing[0], thing[1], thing[2])

    digits = digits_generator()
    for thing in digits:
        lookup(thing[0], thing[1], thing[2])


if __name__ == "__main__":
    main()