def extract_domain(var_name, output):
    """
    Extracts just the domain name from an URL and adds it to a list
    """

    var = getenv(var_name)

    if var:
        p = urlparse(var)
        output.append(p.hostname)