It depends on why your dog is barking. It would be irresponsible to formulate a diagnosis or recommendations without more information. However, the first thing I would recommend is a visit to the veterinarian to rule out any medical problems. Then consult a knowledgeable, reward-based trainer, preferably a clicker trainer or a certified applied animal behaviorist or board-certified veterinary behaviorist to help you formulate a behavior modification plan. The plan will require a through assessment of the reasons for your dog's barking, the triggers, etc. I can tell you this, telling your dog to "knock it off" will not work, as you have discovered. Most behavior modification plans I write include a plan for sufficient exercise and mental stimulation, so if you are not providing adequate amounts of physical and mental exercise, make plans to do so, through reward-based training, daily walks, interactive dog toys and various outings.