The Dow Jones Industrial Average clawed back 82 points today, as investors tried to keep the bear market rally going in an extraordinarily uncertain time for investors and the global economy.

Data showed that inflation stayed high in May, leading the Federal Reserve to jack up its benchmark overnight lending rate, the federal funds rate, by a whopping three-quarters of a percentage point at its June meeting to try and bring down consumer prices.

Recently, Loretta Mester, the president of the Federal Reserve Bank of Cleveland, told the public to expect another three-quarter percentage point increase at the Fed's meeting in July should economic conditions remain the same.

I'm guessing June data for the Consumer Price Index will tell investors a lot about the economic conditions Mester is referring to. One stock, in particular, helped the Dow stay green today, as investors continued to look for companies that are both inflation- and recession-proof.

These burgers are recession proof

Atlantic Equities analyst Edward Lewis upgraded McDonald's (MCD 1.32%) from a neutral rating to overweight today, while also lifting the fast-food chain's price target from $245 per share to $278. Shares of McDonald's closed the day up more than 2%, trading just below $245 per share.

The stock has performed reasonably well this year, only down nearly 8%, which compares favorably to the S&P 500, which is down more than 20%.

Lewis upped his rating and price target for McDonald's due to the stock's strong performance during economic downturns. Lewis also called McDonald's a "defensive value play" as spending by consumers starts to decline.

One of the reasons McDonald's is a good stock during times of inflation is because it has arguably the strongest brand in the fast-food universe, making it unlikely that people stop eating the Big Mac or other hallmark orders during a recession even if the cost of the food goes up.

It's the same reason why people refer to pizza as a recession-proof business. It's one of those purchases that people will likely keep in their budgets no matter how constrained their finances get.

Another thing McDonald's has going for it, as noted by CFO Kevin Ozan on the company's most recent earnings call, is that prices of food cooked at home have increased at an even faster pace than prepared foods. So why give up eating out if it's going to be a similar expense to buy groceries and cooking food, which includes doing the work.

Is McDonald's a buy?

I never think it's a bad time to hunt for bargains in any sector of the stock market. But given the uncertainty in the environment and the chance of a recession in the near term, I would agree that it's also not a bad idea to buy stocks like McDonald's that have a track record of performing well under difficult economic conditions.

McDonald's has also exited Russia, removing that risk from its business, and kept up with the times, adding a strong digital component to its operations, which gives it better data on its customers. For all of these reasons, I would rate the stock as a buy.