Is the Nintendo network ban tied to NNID or the console?

I'm considering buying a second-hand New Nintendo 3DS, mainly to play Pokemon Sun/Moon which is a bit "heavy" for the old 3DS.
But there's a thing that restrains me. I've heard that players who downloaded pirated copies of Pokemon Sun/Moon are having their 3DS systems banned from all of Nintendo's online services:
As a result of a number of Nintendo 3DS users using unauthorized versions of several games, and connecting to the official game servers in violation of our terms of service, these users’ Nintendo 3DS systems that stored the unauthorized game code have been banned from Nintendo's online network effective immediately.
So, here's my question:
Is this ban tied to the user Nintendo Network ID or to the 3DS itself?
In the former case a format of the 3DS will solve the problem. But the latter is a big deal, I don't want to buy a not-specified-length-of-time banned 3DS, and I can't test them if they are sold online.
Best Answer
Actually, both kinds of ban exist. Device bans are usually handed out for piracy involving firmware modifications, since NNID on such systems has no value as it can be easily re-created. There are NNID bans (e.g. 005-5964) which are applied to people whose wrongdoings can be tied to a NNID, such as some cases of cheating or games bought with a stolen credit card.
In the latter case, factory reset will restore the device's ability to connect to servers, but of course you will lose all the perks that the previous user has illegally acquired.
Pictures about "Is the Nintendo network ban tied to NNID or the console?"



Does Nintendo ban accounts or consoles?
Does Nintendo ban accounts or devices? Although Nintendo does ban accounts for smaller infractions such as language and not paying your subscription fees, recently they have begun banning gamers devices who are cheating, modifying their games or devices, or using pirated or home brewed software.Can Nintendo ban your console?
Nintendo bans accounts and consoles for a variety of reasons but console bans are normally reserved for the most severe violations of their terms of service such as piracy, theft, hacking, etc.What happens if Nintendo bans your console?
A banned Switch doesn't have access to any online gaming or the eShop. Users can't download games or update their Switch, either. Offline games still work, like those in old-school gaming consoles. Bans are often put in place after a user tries to hack or tamper with the console, or after buying pirated games.Why did my Nintendo Account get banned?
Getting banned on Nintendo happens far less often than you would think as many times what people call a ban is simply a temporary suspension. For your Nintendo account to be banned you have to do some pretty severe things such as download pirated software, steal customer's information, hack your console or games, etc.GS News - Nintendo Network ID tied to single console
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Tomasz Filipek, Pavel Danilyuk, Stas Knop, Luis Quintero