Is your dog shaking his head and pawing at his ears? Listen up, because Fido could be trying to tell you he has a nasty ear infection.

Ear infections must be diagnosed and treated by a veterinarian — in fact, they’re one of the top reasons dogs visit the vet, according to Nationwide, a provider of pet insurance. The good news is that ear infections usually aren’t too expensive to treat: The average cost of a vet visit for an ear infection is around $100.

There are two main types of dog ear infections: outer ear infections and inner ear infections, says Joseph Kinnarney, DVM, president of the American Veterinary Medical Association.

The more common type, an outer ear infection, causes milder symptoms and often can be prevented by a simple regimen of regular ear cleaning, Kinnarney says.

An inner ear infection is more severe, usually comes on suddenly and tends to happen in older dogs. A dog with this type of infection may get dizzy and fall down, he says. If this happens to your dog, rush to the vet right away. “It’s an emergency for the dog,” Kinnarney says.

Related: 13 Health Symptoms Dogs Should Never Ignore

What causes dog ear infections?

Dog ear infections have a variety of causes — usually bacteria or yeast, Kinnarney says. In some cases, though, a virus could be the culprit, he adds.

It’s also possible that debris stuck in the ear, or even a tumor, could be contributing to an infection, according to VCA Animal Hospitals.

Unlike human ears, dog ears are shaped like a cup, Kinnarney says. Because of their shape, they can hold in fluid, which creates a perfect environment for bacteria and yeast to grow, he says.

Dogs of certain breeds, including those that have floppy ears and a lot of hair inside their ears, tend to be more at risk for ear infections. Cocker Spaniels are the number one breed Kinnarney sees for ear infections. Miniature poodles and Old English sheepdogs also might be more likely than other breeds to suffer from ear infections. However, dogs of any breed can get them.

Dogs that suffer from skin allergies also tend to be more likely to end up with infected ears, Kinnarney says.

Related: Dog Arthritis: What Pet Owners Can Do

Signs of ear infections

How do you know if your dog might have an ear infection? There are two red flags:

1. A funky smell. Odor is probably your biggest ear infection tipoff. “If your dog’s ears smell bad, there’s a problem,” Kinnarney says.

2. Head shaking. A dog with an ear infection often will move her head like she’s shaking off water, Kinnarney says. She might also paw at her ears. “That’s the dog’s way of saying, ‘Ouch! This is kind of an issue,’” Kinnarney says.

Related: Is That Biofilm on Your Dog’s Dish?

Hightail it to the vet

Never try to treat a suspected ear infection at home. Instead, take your pooch to the vet as soon as possible.

First, the veterinarian will use an otoscope — a magnifying tool with a light — to look inside your dog’s ear. Your vet will check for signs of an ear infection like red, flaky skin and discharge. The vet also will make sure there’s nothing stuck in the ear and the eardrum isn’t ruptured. In some cases, such as if your dog is in severe pain, the vet might use a sedative or anesthesia to do the exam.

Then the vet will take a sample from the ear and perform a culture to determine exactly what’s causing the infection, Kinnarney says.

Depending on the results of the test, the vet typically will clean the ears and prescribe either a topical antibiotic or an anti-yeast medication, Kinnarney says. In very severe cases where an infection has been festering unchecked, the vet might have to surgically drain the ears so the medicine can get in and work, he says.

But the best medicine is prevention. Take your dog to the vet for regular wellness exams, during which your veterinarian will check his ears. If you have a high-risk dog, such as a one with allergies, clean his ears a few times a week, which can help prevent an outer ear infection — and alert you to any signs of trouble quickly.

“The faster and earlier you treat an ear infection, the better the outcome,” Kinnarney says.

Related: 2 Vaccines Your Dog Absolutely Needs, and 4 He Might

Allie Johnson is an award-winning freelance consumer writer with a degree in magazine journalism. She lives in Georgia with her husband and two dogs.