def _format_dns(dns):
    """Create the DNS section of the NIC config file.

    :Returns: String

    :param dns: A list of DNS servers to use.
    :type dns: List
    """
    tmp = []
    for idx, dns_server in enumerate(dns):
        server_num = idx + 1
        dns_config = 'DNS{}={}'.format(server_num, dns_server)
        tmp.append(dns_config)
    return '\n'.join(tmp)