Generate main ns