Ask a Dog Vet and Get Answers to Your Dog Health Questions
It sounds like you're dealing with an ear infection. The common signs include itching at the ears, shaking the head and inflammation/ debris visualized in the ear canal.
These can be treated with topical ear medication. The meds include an anti-fungal for the yeast, antibiotic for the bacteria and steroid for the inflammation in the ear canal. Otomax and Mometamax are the most commonly used. They are not available over the counter, so you will need to get a vet prescription. Many vets will refill it for a dog that they have seen in the last 12 months, so I'd call them first and ask.
In the mean time, you can clean out the ears with a diluted hydrogen peroxide solution or over the counter ear cleansing solution.
You can also give Benadryl (Diphenhydramine) at a dose of 1-2 mg per lb every 6-8 hours as needed for the itching.
I hope this helps, let me know if you have any other questions.