Gwynedd gang boss Paul Williams, 40, was jailed for 19 years at Caernarfon Crown Court on Wednesday with others sentenced on Thursday and Friday.
He used a secret phone while in prison to maintain control, the court heard.
North Wales Police said they monitored thousands of calls on over 100 mobile phones to crack the case.
The judge has said it was a "scandal" Williams, from Bangor, was able to make up to 295 calls in one day while already behind bars and he wants the Home Office to explain how this was allowed to happen.
The court was told heroin, cocaine, cannabis and mephedrone was brought into north west Wales by criminals based in north west England and then distributed by a network of local dealers.
The last defendant sentenced on Friday was Scott Anthony Jones, 34, who was jailed for seven years and eight months after pleading guilty to conspiracy to supply drugs at previous hearing.
Not all defendants were jailed. Some received suspended jail terms and community orders.
After the sentencing hearings, Det Insp Arwyn Jones from North Wales Police said: "This is one of the biggest criminal enterprises North Wales Police have taken on."
He said the success of the covert police investigation, codenamed Operation Measure, had helped to make the region safer due to the scale of the gang's operation and the fear they caused communities to "run their empire".
In April, 26 people involved in another drugs gangs in north Wales were sentenced after a five-year covert police exercise, Operation Yonside.
One of the "biggest criminal enterprises" ever seen in north Wales has been dismantled with 29 members of a drugs gang sentenced by a judge.