Ah, the rat. We have stories about leading the rodents out of towns with flutes and associate them with the spread of the plague (even if science has somewhat exonerated them of the last one).

In any case, when we see rats around our homes, we immediately want to do what we can to stop them from gaining a foothold. According to Orkin, a pest-control company, an estimated 25 percent of unexplained wildfires start due to rodents gnawing on wires. Their burrowing habits can cause issues in homes' foundations as well.

"Rodents like to chew on wood and electrical wires, increasing the fire danger behind your walls and potentially damage to your home," said John Kane, entomologist and Technical Director of Orkin's Midwest region.

And that's not all.

"Beyond property damage, there are other important reasons to prevent, notice and eliminate rodent infestations," Kane explained. "They can contaminate food and transmit pathogens through urine, feces and bites that affect health."

So what can you do to get rid of rats in your home?

Know what to look for

First, you should seek out the signs you have a rat issue. Terminx, another pest-control company, lays out the signs of a rat infestation:

Droppings

Gnawed wires or wood

Rat tracks

Scurrying sounds

Musky scents

The presence of living or dead rats

Grease marks along certain surfaces, left behind by a rat hugging a wall as it scurries about, can also be a sign that your home has become a favored spot for roof rats in particular. [How does your city rank? Top 50 cities for rats in the U.S.]

The best offense is a good defense

Rats will take any path into your home they can find, including the height granted by a tower of tires. Holger Kirk/Shutterstock

Like with many pest problems, prevention will save a lot of time in the long run and help you from having to deal with a full-blown infestation.

To that end, home maintenance plays a big part in keeping rats out of your home. Since rats can squeeze through just about any hole their head can get through, sealing up holes and gaps both inside and outside your home will make a difference. The Centers for Disease Control and Prevention (CDC) has a list of places to look for around the home, including around vents, fireplaces, closet floor corners, windows and the roof.

To fill these gaps, the CDC recommends using steel wool and then calking the wool in place for small holes and "lath screen or lath metal, cement, hardware cloth, or metal sheeting" for larger holes.

In addition to sealing up holes, you'll want to make it as hard as possible for rats to climb into your house. Prune back tree branches touching or extending over your roof, removes vines from the walls of your home and install tree guards to discourage rats from gaining the high ground.

Other tips include securing garbage lids and food storage, ensuring that bird feeders are safe from all varmints and maintaining a clean wood pile.

If you'd prefer something a little more wild, cats and barn owls love catching and munching on rodents. The Hungry Owl Project has more on what you can do to discourage rats by using these winged predators.

You may also want to consider consulting the principles of Integrated Pest Management (IPM). This approach, as described by the U.S. Environmental Protection Agency, "relies on a combination of common-sense practices" that are "used to manage pest damage by the most economical means, and with the least possible hazard to people, property, and the environment." While originally developed to handle pests to plants in the 1970s, IPM has been adapted to handle all kind of pests, including rodents.

When the rats are already inside

Even if they're in the house, there are steps you can take to get the rats out of there. vladimir salman/Shutterstock

If it's too late for preventive measures, here's how to handle the rats once they're inside the house.

Reusable traps, both the kind that kill and the kind that don't, are available and come in a couple of varieties. Two-door traps can be set with both doors open to snag a rat on the run, while single door traps lure in and trap a rat whole by placing bait at the other end.

For bait, Havahart, a wildlife control company, has a few different recommendations. For Norway rats, foods high in sugar and fat and peanut butter are your best bet, while roof rats prefer fruits and nuts. Peanut butter is a good lure for both types of rat. Havahart also recommends wearing gloves while preparing your bait since rats aren't fans of human scents and may avoid any food that reeks of humans.

If you're using deadlier traps, check with your county's health department on how to properly dispose of the corpse. If you're using live traps, however, you'll need to figure out a way of releasing the rats back into the wild and at locations a good distance from your home — and anyone else's for that matter.

But if trapping isn't your forte, calling professionals may be your best option. Inquire about integrated pest management services the pest agency offers if you'd like to avoid outright extermination of the rats.

What about rat poisons?

Rat poisons are an option, but there are reasons to be wary of them.

First, while rat poisons say "rat" in the name, they're poisonous to other creatures as well. Most rat poisons are anticoagulants that thin the blood and eventually cause death due to internal bleeding. Humans and pets will suffer if they ingest rat poison, if not outright die. And the poison can have a second life if a wild animal eats poisoned rats (or eats other animals that ate rat poison or poisoned rats). That predator would also be poisoned, eliminating a natural form of rodent control.

Second, rat poisons may solve the problem while creating another. Yes, the rats may die, but if they ultimately die in a fairly inaccessible place, like a well-hidden nest, you may be stuck with a rat's smelly, rotting revenge wafting through your vents.