code: def match_host (host, domainlist):
      
      if not host:
          return False
      for domain in domainlist:
          if domain.startswith('.'):
              if host.endswith(domain):
                  return True
          elif host == domain:
              return True
      return False
docs: Return True if host matches an entry in given domain list.