def _parse_resolv_conf(contents):
    """
    Return a list of nameservers declared in ``contents``, a string with
    resolv.conf-like syntax.
    """
    resolvers = []
    for line in contents.splitlines():
        fields = line.split()
        if len(fields) == 2 and fields[0] == 'nameserver':
            resolvers.append(fields[1])
    return resolvers
