code: def extract_domain(var_name, output):
      
  
      var = getenv(var_name)
  
      if var:
          p = urlparse(var)
          output.append(p.hostname)
docs: Extracts just the domain name from an URL and adds it to a list