Before jumping to medication I would take a closer look at exactly what you feed your dog. Check to see if there are any dairy products (milk) on the ingredients list on the dog food bag. Many dogs have lactose intolerance where they don't have the necessary enzymes to digest the milk sugar lactose. This can cause dogs to be very gassy. Some dogs also have a hard time with excess soy in food. So if soy is one of the top ingredients try to switch to a food with less soy.
There are many kinds of dog food out there so try different kinds. Avoid table scraps because that also can cause some gas especially in a puppy. Also, try to feed you dog more. Not more in amount but the same amount split into more smaller portions over the course of the day. Dogs can be gassy if the gobble up a large amount of food at one time.
If you do switch foods, do it gradually or you may end up not only with a gassy dog, but one that also has diarrhea. A lower protein food may do your dog some good, as excess protein also can cause gassiness. I would suggest that you also consult a veterinarian as he will have the best advice for your dog, especially a vet that treats your dog personally and knows more of its health history. Try these things and see if they help.