I have a gas water heater. Starting yesterday, when the flame is on, the unit makes a squealing noise of moderate volume. The noise stops immediately when the flame turns off. This means it is not caused by water pressure in the tank, which would take at least a moment to stop after the flame switched off. What causes this sound?
My guess is that something in the gas supply line of the heater is whistling (a vibration is being induced from the flow of gas). This could indicate a blockage or deformation of one or more of the gas jets. It's unlikely to be any problem with the exhaust flue or with the water in the tank, as you say.
The other thing it might be, depending on the tank's proximity to your gas meter, is that the gas reg on the meter (which steps down pressure from the gas main to a level suitable for your home's appliances) is starting to fail, and the heater, being closest to the gas reg, is picking up a vibration through the gas line that is induced by the failing reg. This is less likely especially if no other appliance makes the slightest noise, and the reg itself isn't making any noise when gas is flowing.
As far as fixing it, this is something I'd leave to a pro, but that's just because I know enough about gas to know I can seriously screw it up. The fix would likely be to replace any obviously crushed or deteriorated gas pipes and fittings in the HWH installation, and possibly disassemble the line back to the wall to make sure there aren't any nicks or dents in the pipe ends from where the installer dropped and damaged one, then installed it anyway.
I experienced the same bad squeal when running a Rinnai 200e instant hot water heater. It was explained to me as "kettling". The water was boiling in the heat exchanger. A bit like the noise the bottom of a kettle makes when it is on a gas stove. The water pipes transmitted it loudly around the house as a squealing moan. We tried descaling the heat exchanger first then Rinnai thankfully replaced the heat exchanger no charge.
I just bought a Sears water heater and it was making a loud whining-droning noise. (the Sears store told me it was the flue that the non Sears plumber installed- this was baloney) I called Sears tech and the repairmen said it was a known problem in a gas valve- took him 10 minutes to fix it. I couldn't see exactly what he tweaked next to the burner. But until the maker of these units posts a consumer doable fix, I suggest you call the manufacturers tech support.
Have you checked your inlet pressure and compare with the manufacturer's specified manifold pressure? If the inlet pressure is too high, you may need to install an appliance regulator and adjust it to the manufacture's specified pressure.
The problem isn't with the gas line, it's with the water flow out of the water heater, the demand for hot water is greater than the tank can put out, you'll need to install a 6-10 gallon electric water tank directly out of the tankless water heater, this way you won't deplete the hot water. Totally it will cost about 600-1,000 to stop the squeal. I know, it's what I had to do. But yes, have a drip tube on your water heater, a must. Also, use a 3/4" gas feed to the heater.