If Mexico City is the country’s sprawling city of the future and the Yucatan is its always-out-of-office hub for beaches and Mayan ruins, Oaxaca is Mexico’s foodie heart. This province, just a few hundred miles south of the capital, is arguably home to the best cooking in the country. Unsullied by Tex-Mex or Californian influence, come to Oaxaca to taste mole and chapulines (yep, grasshoppers) — plus mezcal that will make you forget you ever flirted with tequila.

Its gourmet rep is partly thanks to geography: produce from Oaxaca’s lush, fertile central valleys is highly prized. Indeed, Mexico City foodie temple Pujol, the brainchild of chef Enrique Olvera, largely relies on Oaxacan fruits and vegetables. “People here have just found this way to live off all the magical things the earth gives you: herbs, plants, insects. Everything has a deep sense of its origin there,” swoons Camille Austin, who works for local mezcal brand Montelobos.

Oaxaca’s history also contributes to its culinary prominence: this is a region where the influence of pre-European cultures remains strong, with street signs in both Spanish and Zapotec, a pre-Columbian language that’s still often the lingua franca among locals. The food reflects these diverse influences, as does the annual Day of the Dead festival: It’s in Oaxaca that this blurry fusion of Christian and pagan ritual is celebrated most fiercely. (Book now for next year’s celebrations between Oct. 31 and Nov. 2 and skip the bash in Mexico City made famous by the opening scenes of the 2015 Bond film “Spectre” — that parade is entirely ersatz and has only been running since the movie was released.)

Don’t fret about the recent earthquake that hit the province, either. Fortunately, it left capital Oaxaca City largely undamaged; the cobblestone streets, lined with brightly painted colonial-era buildings, and wide, tree-shaded plazas look like movie-set Mexico. Strolling around the compact city center, the intoxicating smells of cooking waft out onto the street. Oaxacan food is hearty and slow-braised, and its creators are drawn to any available ingredient, even insects (another legacy of the area’s Mesoamerican past). The chicatana ant, for example, is like insect caviar, emerging after the rains once a year each spring, and painstakingly collected to make into precious powders and sauces. Oaxaca is commonly nicknamed the land of the seven moles, though that lowballs the true number; it seems like every restaurant has its own take on the rich, thick sauce served on almost everything.

That’s certainly the case at the newest Oaxacan hotspot, Criollo. Nearly a year and a half old, its pedigree is peerless, counting among its owners Pujol’s beloved Olvera, who also runs Cosme in New York. The sprawling restaurant has a few airy dining rooms up front, but the best perches are the bench-style tables in the yard out back. They’re close to the open grills that the kitchen team use to prep almost every dish in the seven-course tasting menu: warm bean tortillas with house-made black mole and roasted quail, or chicharron smothered in guacamole and a fiery purée of grasshoppers and chilis.

Rodolfo Castellanos is another standout local chef; indeed, he won the inaugural season of “Top Chef: Mexico” last year. The name of Castellanos’ restaurant, Origen, is a nod to his menu, one that reaches back into Oaxaca’s history and his own childhood. Expect more insects (the suckling pig is smothered in a delicious mole based on those chicatanas) and tamales made from mangrove mussels. At lunchtime, for a casual riff on Oaxacan comfort food, head to brightly painted canteen La Olla.

Chef-owner Pilar Cabrera relies on her grandmother’s recipes for rich, chocolatey mole, black bean-smeared tortillas and pumpkin salad. Cabrera and her family also run Casa de la Bugambilias (doubles from $90), a trio of houses in the city center converted into charming B&Bs that are among the most appealing overnight options around. The Cabreras also run a cooking school if you’re keen to take home some of their recipes.

It isn’t just food that lures gourmands to Oaxaca, though: this state is also the home of mezcal, with more than 80 percent of the country’s production. Like tequila, it’s made from agave, but with none of the regulations that constrain the manufacturing of its better-known counterpart. It’s the original small-batch, artisanal spirit: dozens of agave varieties grow in the fertile soil, and rickety distilleries or palenques, or distilleries, sit by the roadside, where families cook up the hearts in fire pits before crushing them with a huge stone tahona, or millstone pulled by a donkey.

The liquor, a smoky cousin of tequila, only recently became commercialized. “Mezcal is the granddaddy of all agave spirits,” says Montelobos’ Camille Austin. “The culture of making mezcal was to produce it for the communities to share amongst themselves when they were celebrating, and it was only a few years ago that people came and started bringing brands.”

There are several mezcal-heavy nightspots in the city center, where you can sample the plethora of options. (There are more than 200 varieties of agave, and each gives a different flavor to whatever final product the bartender is pouring.)

Try the speakeasy-style El Destilado, or the rowdier Sabina Sabe, with its own postcard-sized dance floor that throbs with activity late at night. During the day, idle over a snifter or two at the hipsterish Mezcalillera, a closet-like bar outfitted with raw light bulbs and metal panels; it sells full-sized bottles of anything you try to take home.

Grab a bag of chapulines, too; then graze on crispy grasshoppers while sipping some mezcal to transport you back to Oaxaca once again.

The author was a guest of Montelobos mezcal.