Dividends are a great thing. They allow shareholders to profit directly from the cash a company brings in. For beginning investors, the temptation to buy high-dividend stocks can be irresistible.

But before throwing your hard-earned cash behind these stocks, it's important to understand just how sustainable a dividend is. The following two companies are textbook examples of the importance of doing your own research before buying high-dividend stocks.

Roundy's (NYSE: RNDY)
This company owns a number of grocery stores in the upper Midwest, most notably Wisconsin's Pick 'n Save chain. Though the chain had a 58% share of the southeast Wisconsin market in 2010, that has declined as competition has eaten away at Pick 'n Save's foundation.

Back in October, I warned investors that Roundy's 14.4% dividend was simply unsustainable. During the first 12 months as a public company, it brought in $16.5 million in free cash flow -- which is what dividends are paid from. The company was essentially paying out $20.6 million in dividends.

It doesn't take to much math to see that this was a recipe for disaster; one month later, Roundy's was forced to cut the payout by 48%!

But even with the lower payout, the stock still yields a hefty 6.6% dividend. Is this sustainable? Check out how the company's free cash flow looks compared with the dividend payout.

Free Cash Flow (Trailing 12 Months)

Expected 2013 Dividend Payments

Payout From FCF

$27.5 million 

$21.5 million 

78%

Source: SEC filings.

To be fair, paying out 78% of your free cash flow for dividends isn't that alarming. But look at the underlying business, and there's cause for concern.  

Same-store sales have declined every year since 2009. And the company's earnings release yesterday stated that -- if not for a shift in when holidays fell on the calendar -- same-store sales declined again in the first quarter of 2013. Over time, you have to wonder where the cash is going to come from to keep paying these dividends.

Frontier Communications (FTR)
Frontier is a telecom company undergoing a major shift in its business model. Formerly, the company focused on rural landline telephone service. Obviously, as mobile phone service coverage becomes better with time, Frontier's traditional business will suffer.

That's why the company is focusing on two things: bundling services together, and winning over business clients to replace shrinking residential accounts. It's uncertain yet how effective that new approach will work.

In the meantime, Frontier, like Roundy's, has already cut its dividend once, back in early 2012. But the company's stock still yields a hefty 9.9% dividend. How sustainable is this dividend?

Free Cash Flow (Trailing 12 Months)

Expected 2013 Dividend Payments

Payout From FCF

$762 million 

$399 million 

52%

Source: SEC filings.

On the surface, Frontier's dividend looks pretty healthy, but if you take a deeper look, there are serious questions that need to be answered. Revenue fell 4.4% during 2012, and that trend continued in the first quarter of 2013, as revenue fell 5% from one year ago.

As fellow Fool Eric Bleeker points out, two other factors could make it difficult for Frontier to continue paying out its dividend over the years.

First, the company is coming under scrutiny for its balance sheet, and the first shoe has already fallen: Fitch recently downgraded the company's outlook from "stable" to "negative." If other ratings agencies take a look, a similar outcome could follow. And if that happens, borrowing money becomes more expensive and puts pressure of free cash flow.

Second, Frontier had to pay only $4.7 million in cash taxes in 2012. But in just the first half of 2014, the company will probably have to pay $80 million -- putting further pressure on free cash flow.

What's a Fool to do?
Before running for the exits when it comes to these high-dividend stocks, stop and think. If Roundy's is able to stabilize its business, and if Frontier is able to win over business customers, their dividends will probably remain healthy.

But those scenarios are far from guaranteed, and they need to be fully appreciated before buying shares just because of an outsized payout.