def strip_dns_suffix(hostname):
    """
    Returns the first segment of a hostname (e.g. returns 'google' for the value 'google.com.au')
    Not intended to be used with hostnames beginning with www - will return 'www'
    """
    return hostname.split('.')[0] if '.' in hostname else hostname
