It is caused by various agents including Bordetella bronchiseptica (Bb), canine adenovirus type 2 (CAV-2), canine distemper virus (CDV), canine herpesvirus (CHV), canine parainfluenza virus (CPiV), canine influenza virus (CIV), canine respiratory coronavirus (CRCoV) and canine pneumovirus (CnPnV). Dogs are likely to carry round some of these pathogens without problems, but an increase in viral load or the amount of the Bordatella bacterium can produce the characteristic signs of a hacking cough, loss of appetite, lethargy and raised temperature. It may sound as of your dog has something stuck in his throat as the cough often ends with a gagging acton, similar to human whooping cough.
It gained the name kennel cough because it is highly infectious and often endemic in kennel environments. Dogs can pick it up from the air, from fomites (human hands, clothing bedding etc) and from infected dogs. Cats and rabbits can also catch it and, very rarely, humans.
Generally speaking, most dogs will recover with rest but always check with a vet if you have a puppy or older dog or the signs are severe. Your vet can advise you about administering cough medicine to help your dog – and you – get some sleep.
Most importantly, keep your dog away from other dogs and keep exercise down to a minimum. You can vaccinate against Bordetella bronchiseptica and it will usually be required (two weeks beforehand to allow immunity to develop) if you board your dog with a reputable kennels.