The ban was about improving academic outcomes for children, Mr Luxon said.
"We’re really determined to do everything we can to remove distractions from kids so they can focus on learning and teachers can focus on teaching."
Otago Boys’ High School rector Richard Hall said he had already enforced a cellphone ban last year and it had been positive for the school.
The nationwide ban was a good idea because if there was a national regulation it would make it easier for principals to enforce the ban without consulting the wider school community.
The ban led to pupils talking face-to-face and playing in the playground.
"We’ve had a noticeable decrease in online issues and, but also more importantly, we’ve just got a school environment where boys are interacting more.
"They’re just being normal kids again, which is great instead of just staring at their phones."
Pupils had to turn their cellphones off and leave them in their bags and if they were caught with their phone, they would get detention and their phone confiscated.
Otago Secondary Principals’ Association president and South Otago High School principal Mike Wright said he believed it was important for schools to have a say in what worked for their individual communities.
"Schools are supposed to be self-governing entities and I think schools do develop their own processes and practices that enable management of these sorts of issues."
Mr Wright said he thought there were some risks associated with the ban.
While he appreciated cellphones were a distraction to pupils, they were useful tools for them to use.
"I have some students who do a building programme which is in conjunction with local industry and Otago Polytechnic, and the tutor requires that the students photograph their work.
"So access to a cellphone in that instance is the most logical and viable way for students to record their work."
The wider community, including parents, would need to be on board with the ban for it to work.
Waitaki Girls High School (WGHS) was another school that had enforced a cellphone ban.
Principal Sarah Hay said the choice should be made on a school-by-school basis.
Although the cellphone ban had been "very successful" at WGHS, different schools had different needs and she was "not going to tell any other school what to do".