Kennel cough can last a couple of months, in that case, it's very important to be checked by a vet bc kennel cough can lead to pneumonia. The hacking/coughing is more present during late night & early morning hours, sometimes accompanied w/runny nose or eyes.
Kennel Cough: Symptoms, Treatments, Contagious, Causes, and More
Since he's hacking after he drinks water & he's done this occasionally since he was a pup, I'm wondering if using a water bottle might help him? Walmart sells those bottles for rabbits, needs to be attached to a gate or x-pen. Mine use the water converters I sell & also have fresh clean water in a bowl, they can choose whichever way to drink.
Acid reflux also makes them hack...