NEW YORK, OCT. 31 -- The Dow Jones industrial average eased 5 points today after a midafternoon rally attempt failed.

The loss occurred despite a 17-point morning advance and moderate rallies in the U.S. bond market and dollar. Observers said it appeared that bond and stock traders were each hearing different news on prospects for peace in the Middle East.

The U.S. 30-year Treasury bond was up nearly half a point as stocks closed. The dollar rose more than a yen and a third of a pfennig against the German mark. And although December crude oil futures finished up 69 cents per barrel at $35.23, oil prices were moderately lower for most of the day.

At the close, the Dow stood at 2442.33, down 5.69, while declines barely snatched the lead from advances on the Big Board in the last hour of trading. New York Stock Exchange volume was moderate at 156 million shares.

Corporate earnings from Eastman Kodak and General Motors failed to move the market as a whole, traders said. Kodak reported a third-quarter loss of 64 cents a share, compared to a 93 cents gain a year ago, but the results included a $909.5 million award to Polaroid as settlement for a patent-infringement suit. Kodak managed a 1 1/4 gain on the day to 39 3/4, despite the late blue-chip sell-off.

General Motors stock finished up 1/8 at 36 3/4 despite a 3/4 loss in early action, immediately after the company reported a mere 2 cent-a-share gain in the third quarter, compared to 72 cents a year earlier.

Among other Dow components, Bethlehem Steel gained 1/4 to 11 3/8 despite reporting third-quarter net at 5 cents a share compared to 54 cents a year ago. But IBM fell 1 to 105 3/8, International Paper lost 1 1/4 to 46 1/2 and Merck dropped 1 7/8 to 76 7/8 amid widespread losses in the pharmaceuticals.

Among the drug stocks, Eli Lilly was slapped to a 2-point loss at 67 3/8 after trading as low as 66 on resurgent worries about sales of the company's important Prozac drug. Bristol-Myers Squibb fell 1 3/8 to 58 3/4, Pfizer dipped 1 3/4 to 72 3/4, Schering-Plough lost 1 3/4 to 43 3/4, and Warner-Lambert surrendered 1 1/4 to 61 5/8.

Elsewhere, food stocks also suffered in today's virtual market vendetta against stock groups that proved among the most resilient during the August-September massacres. Kellogg slid 3 1/8 to 68 1/2 despite comments from its president that it would be more conservative in raising prices on its major products in the future because of increased private label competition. Rival General Mills toppled 3 1/2 to 83 1/8, Borden skidded 1 7/8 to 28 7/8 and Ralston Purina eased 1 to 99.

Among other prominent movers, industrial-systems specialist Tyco Laboratories plunged 5 5/8 to 38 3/8 on a lowered recommendation from Merrill Lynch after Tyco management told analysts that 1990 earnings would disappoint them. Merrill dropped its rating to "neutral" from "buy," and although Lehman Brothers kept its "buy" recommendation intact, both firms lowered their 1990 earnings estimates by slightly more than 5 percent.

On Tuesday, the utilities surged 2.58 points, and they advanced another 2.32 points today to close at 213.28. They have generally outperformed other stock indexes for several weeks, and today moved to their highest level since mid-June.

The Dow transports inched down 2.76 to 822.31, technically still holding the triple-bottom they have traced out since late September.

Broad stock indexes finished narrowly mixed. The Standard & Poor's 500 was down 0.06 at 304.00, the NYSE Composite up 0.09 at 166.17, the Value Line up 0.16 at 216.89, the Amex Market Value down 0.28 at 287.79 and the Nasdaq Composite up 0.01 at 329.84.