Thank you for the information. Yes, we are certainly always worried about bloat (twisted stomach) with our top sign being dry heaving without production of vomitus, but usually a dog with this going on would have abdominal/stomach pain and not be eating/drinking normally. So, this is highly unlikely.
I am afraid I cannot provide you an exact diagnosis for what is causing this dry heave/hack, but the drooling is probably secondary to nausea. In order to try to figure out what is going on he would need an examination followed by some testing that might include lab work (CBC, chemistry profile, urine check) and radiographs (X-rays).
We do need to make sure this is not a medical emergency. If he at any point seems painful, depressed/lethargic, develops blood in the vomit, develops diarrhea or stops eating then he needs to be seen on emergency. I am highly concerned this has been going on for a day and does not seems to be stopping. This might suggest there is something in his stomach or upper small intestinal tract that is causing a partial obstruction or a lot of pain as it passes through. There are certainly many other possible causes.
I can give you some hints to try at home to help him improve, if you would like. But if you feel he is worsening in any way then I think having him seen on emergency today would be his best option.