Swollen glands in a dog are most likely caused from an infection. This could be a more serious condition, though. A vet should be consulted for a proper diagnosis.
Sounds like an infection. This is where the lymph glands are located. They swell because they become full of drained dead white blood cells that were used in fighting the infection.