Veteran diplomat and historian George F. Kennan yesterday advocated a declaration of war against Iran over the hostage issue and quiet diplomacy with the Soviets over Afghanistan as well as a range of other alternatives to current U.S. foreign policy.

Testifying before the Senate Foreign Relations Committee, the former ammbassador to the Soviet Union and author of the postwar "containment" policy, expressed grave concern about the consequences of official attitudes and actions.

Kennan suggested that present policy toward Iran is not tough enough to bring about release of the American hostages before their psychic and physical health is endangered. On the other hand, he described policy toward the Soviet Union in Afghanistan and the Persian Gulf as so inflexible that it could bring an unwarrented drift toward a U.S.-Soviet military conflict.

Regarding the hostages, Kennan said that "if we temporize too long, our concern for their safety may be deprived of much of its meaning" because of the effect of lengthy confinement on the U.S. diplomatic personnel. He recalled the serious effect on his health of 5 1/2 months' confinement by the Germans in 1941-42.

In a prepared statement, Kennan said the United States should "hold in readiness" means of unilateral pressure on Iran, including military pressures, in case of failure of the present United Nations-sponsored efforts for a negotiated release. Under questioning by Sen. S. I. Hayakawa (R-Calif.), Kennan said that in the face of "unprecedented insults" by Ayatollah Ruhollah Komeini and others, he wondered why the United States did not consider itself at war with Iran.

A declaration of war, Kennan continued, would enable the United States to ask a third country to neogtiate on its behalf in Tehran, as well as legally to intern Iranian officials in the United States. A swap of diplomats could "offer something to get [Iran] off the hook," he said.

If the United States decides to take military action against Iran, Kennan said, it should tell the Soviets what it is doing and why. In view of the 1921 Soviet treaty with Iran, which is still considered valid in Moscow's eyes. Kennan said previous U.S. military activities in Iran, including vast arms sales and major intelligence activities during the shah's rule, had caused "insecurity" in Russia because Iran is on its border.

On the range of U.S. policy flowing from the Soviet invasion of Afghanistan two months ago, Kennan said:

The Soviet action was undertaken for purposes far more limited than a drive to the Persian Gulf. It has not imporved the Soviet posture to have seven to nine of its 23 or 24 border divisions tied up "in that unprofitable venture." A direct Soviet thrust to the Persian Gulf would be through chaotic Iran rather than through the inhospitable Afghan hills on a tangent to the southeast.

The U.S. aim should be the "gradual dismantling" of Soviet military involvement, which is possible as Soviet leaders come to understand that they "got themselves into a jam" in Afghanistan. In Kennan's view the United States should not seek to increase the Soviet difficulty there through aid to rebel forces, but rather to explore the hints that the Soviets may seek a way out.

The United States, its European allies and Japan should consider working out a broad explicit international understanding for neutralization and protection of the Persian Gulf, with Soviet participation in the arrangement. Soviet withdrawal from Afghanistan would be required, and might be aided by such an arrangement.

The high degree of U.S. dependence on Persian Gulf oil is "highly dangerous . . . degrading . . . intolerable" and should be changed by a top-priority conservation and substitution effort. Voluntary measures stiffened by strong governmental action are needed in this effort.

The 76-year-old retired diplomat and Pulitzer prize-winning historian suggested restraint in public alarms during a buildup of U.S. military forces relevant to the problems of the Persian Gulf.