import requests
import gzip


def get_geoip_database(url, filename):
    """ Updates root domain file.

    :param url: URL of the MaxMind GeoIP City Database.
    :param filename: File name to write the db.
    """

    r = requests.get(url)
    with open(filename, 'wb') as f:
        data = gzip.decompress(r.content)
        f.write(data)
    return True