Sen. Edward M. Kennedy returned to Iowa today after a two-week rest and unleashed a two-fisted rhetorical attack on President Carter that was stronger than anything said by the six Republicans in Saturday's debate.

Free for the first time in two months to raise foreign affairs as a campaign issue, Kennedy did so over and over as he carried his quest for the presidency across the flat and frigid plain of southeastern Iowa. Stripped to its essence, his message was that Carter has managed foreign policy the same way he has handled domestic issues: badly.

The administration, Kennedy said at every stop, has been "lurching from crisis to crisis" in domestic and international affairs. If Carter had not dropped out of the Democratic candidates' scheduled debate in this state, Kennedy said, "he would surely have been asked to explain why we have this drift in foreign policy, in domestic issues the energy policy, the inflation problem, and why we haven't been able to anticipate these problems."

The Massachusetts senator, sunburned and rejuvenated after his respite from the campaign, came here to start a week long blitz designed to energize his Iowa organization for the precinct caucuses to be held here two weeks from tonight.

But his traveling campaign staff tried hard to rebut any suggestion that the Kennedy camp is confident about the results here. The official Kennedy line, as set forth by the candidate's press secretary, Tom Southwick, is that Kennedy is far behind Carter in Iowa and will be lucky to scratch out a tie in the caucuses.

Kennedy had been frustrated by a de facto moratorium on discussions of foreign policy by the president's challengers. Kennedy violated it once, blasting the shah of Iran, and was roundly criticized for displaying questionable judgment.

Now that others have begun to attack Carter, Kennedy leaped at the opportunity.

At an airport press conference on his arrival this morning, Kennedy repeated his earlier criticism of Carter's decision to limit the grain sales to the Soviets in response to the Soviet invasion of Afghanistan, saying it would hurt farmers more than the Russians.

In Des Moines, meantime, Kennedy's headquarters moved to exploit the issue by ordering up six gross of caps with the legend, "Embargo Carter," for distribution to farmers at the grain elevators.

First Lady Rosalynn Carter ran into a series of questions on the president's decision on a Des Moines radio call-in show, and defended the cut-back as "absolutely necessary . . . to show the Russians they cannot get away with an action like this [the Afghanistan invasion] without suffering the consequences."

At the same time, Mrs. Carter said, the president "is going to make absolutely sure that our farmers are not the ones who suffer from it."

Responding to a charge made earlier today in Des Moines by California Gov. Edmund G. (Jerry) Brown Jr. that Carter's withdrawal from tonight's scheduled Democratic candidate debate was "cynical, hypocritical, and outrageous," the First Lady said that she and others had "begged" the president to stay in the debate but he felt national unity would be jeopardized by his participation in a partisan event.