Former secretary of the Navy J. William Middendorf's solution to the gas crunch is a 4,000-gallon gasoline tank buried in the front yard of his home in McLean.

The tank, which cost $3,000 installed and is large enough to supply the average American car with gasoline for more than seven years, is what Middendorf calls "an insurance policy for the future.

"I find myself in a situation where I have to get places," he said. "I'm in constant demand from a business, social and political point of view."

Middendorf is among scores of well-to-do people in the Washington suburbs who are spending between $150 and $3,000 to install gasoline and diesel fuel tanks near their homes. In Montgomery County alone, about 100 permits to install private tanks have been issued this year.

Although installation of the private tanks is perfectly legal, it is officially discouraged and has one major drawback-few if any, distributors are willing to deliver fuel to a private home.

"You can't get gas for those tanks now," said Harvey Richard, manager of the Fairfax office of Southern States Cooperative Inc., an oil distributor. "If someone calls us and asks about a tank, we say we probably won't be able to fill it. We tell them they are wasting their maney."

Middendorf, who was appointed secretary of the Navy in 1974 by President Nixon and who now is president of Financial General Bank-Shares Inc., has not yet found a company that will fill his tank, one of the largest at a private home in the Washington area. But he continues to look for a supplier.

Other suburbanites seeking to assure themselves a gas supply include William B. Ingersoll, a prominent Washington lawyer who three weeks ago installed a 560-gallon diesel fuel tank at his Springfield home. The tank, Ingersoll said, will keep his 1978 Oldsmobile Custom Cruiser Wagon running for one year.

"There is a twinge of conscience [about hoarding fuel], but I felt there was no prohibition about doing this," he said.

Alan Hales, a computer marketing expert, bought a 550-gallon gasoline tank for the back yard of his Fairfax County home "because I saw the shortage coming." Hales, an Englishman who said he also kepps 12 loaves of bread in his freezer, said that as a European he is accustomed to shortages.

"I saw a shortage sooner than my contemporaries in America," Said Hales, who bought his tank three months ago. "I'd sooner gasoline was hoarded in my back yard than in a tanker off the coast of New Jersey."

William Lasley Jr. And his wife, Joyce, of McLean said they complied with county regulations and invested $235 in a 275-gallon diesel fuel tank because they "cannot afford to be without fuel."

Joyce Lasley works as a nurse anesthetist at Clinton Community Hospital in Clinton, Md., a 45-minute drive from her home. She said she frequently is called at night to come to the hospital for emergencies.

"I can't call the hospital where there is an emergency and tell them that the service station that sells diesel is closed," she said. "I have to be available or I can't have my job."

The Lasleys get their diesel fuel from the Northern Virginia Oil Co. of Vienna, which doesn't guarantee its recent customers a fuel supply. Five oil distributors contacted in Maryland and Virginia said they cannot guarantee gasoline to people who want to install tanks.

"I get several calls every day from people wanting to put in tanks," said Dave Gee at H.P. Kidd Oil Co. in Landover. "I say, 'Don't do it. We don't have the gas.'"

Both tank dealers and officials in Alexandria and Fairfax, Prince William, Prince George's and Montgomery countries report a sharp increase in the past two months in the number of inquiries about where to buy and how to install the tanks.

Montgomery County Chief Fire Marshal John Dalton said, "As soon as the gasoline crisis or whatever you call it hit, the requests for permits rose."

The Department of Energy recommends against hoarding gasoline or diesel fuel in home tanks. DOE spokesman Tom Tatum said, "All this will do is aggravate the international oil situation by reducing the already tight supply."

There are no federal rules against installing gas tanks on private property and anyone has the right to go out and try to find somebody who will sell fuel, according to Will Webb, a spokesman for energy regulations at DOE. But he noted, "We would be very surprised if they [tank owners] could find any distributor willing to sell."

"Most distributors in the country are operating with 80 percent or less of their gasoline allocation from last year," Webb said, adding that they simply are not looking for new customers.

Installing a gasoline tank in most Washington jurisdictions (with the exception of Prince George's County, which does not allow them in residential areas) involves getting both a building permit and a special permit from the local fire marshal's office.

In Fairfax County, where at least six gasoline and diesel tanks have been installed in private homes in the past two months, the bureaucratic complexities of putting in a tank have discouraged many of the hundreds of callers to the county fire marshal's office.

"When they find out what the requirements are, they usually forget about the tanks," said Deputy Chief Fire Marshall Ronald M.Peck. He explained that the tanks must be properly vented, installed on firm foundations and inspected before they can be used.

Montgomery County requires that underground gasoline tanks be at least 15 feet from a house and 50 feet from the nearest property line. CAPTION: Picture, J.WILLIAM MIDDENDORF ". . . I have to get places"