Affordability is driving more homebuyers away from big cities and toward smaller, unexpected markets. The suburbs of San Francisco and New York City used to be the most attractive, but now names like Omaha, Nebraska, and Rochester, New York, are replacing them.

This year's hottest ZIP codes, ranked by realtor.com, are 49505 Grand Rapids, Michigan; 68144, Omaha, Nebraska; 83704, Boise, Idaho; 66203 Shawnee, Kansas; 14609 Rochester, New York; 48154 Livonia, Michigan; 02176 Melrose, Massachusetts; 76018 Arlington, Texas; 03045 Goffstown, New Hampshire; and 80916 Colorado Springs, Colorado.

It takes just 17 days on average for a home in these ZIP codes to sell, 40 days faster than the rest of the nation. Homes were also clicked on three times as often by realtor.com users, compared with homes in the rest of the country and nearly twice as often as homes in their respective, larger metropolitan areas.

Buyers today are faced with sky-high prices not just in major metropolitan markets, but also in the suburbs that surround them. That is why areas on the outskirts of cities like New York and San Francisco fell off this year's list, and communities around small markets like Omaha and Manchester, New Hampshire, moved on. This year's hottest markets have half of the total number of households of the market's on last year's list and 7% fewer households per square mile.

"Even though buyers are moving to smaller markets, they are looking to retain an urban lifestyle by living closer to the city center," said Danielle Hale, chief economist at realtor.com. "This tells us that today's home buyers are trying to have it all -- proximity to downtown, room to grow, and affordability--and they're finding it outside of the biggest cities in the U.S."

The average commute distance from this year's hottest ZIP codes to their downtown area is nine miles, which is 31%, or four miles, closer compared with last year's top 10, according to Hale.

Also driving the top 10 markets are relatively affordable home prices, large numbers of high-earning millennials and low unemployment. Millennials in these areas are earning 13% more on average than their counterparts in the rest of the nation. The average home price in these ZIP codes is $272,000, well below the national price.

The five newbies to this year's list, Grand Rapids, Shawnee, Rochester, Arlington and Goffstown all have emerging trends that go beyond the usual drivers of popularity.

They have developing local economies and much larger populations of millennials. They do, however, still have room to grow. The median income of residents in these ZIP codes is $64,000, 9% lower than the rest of the top 10. The number of households in these markets is expected to jump 4.3% this year, far higher than the 1.1% national rate.