you have your advice already. Take him to the vet and have things ruled out via blood work and such. It could be nothing or it could be something and gaining peace of mind is priceless.
Your dog could be trying to tell you he's in pain. I agree that a vet visit is warranted here. Blessings - Blu
Has he always done this or is this new behavior?
Of course, the obvious thing to do would be to take him into the Vet for a good physical exam and blood work. I would ask to have his hearing checked.
Aside from that, it may be behavioral. Have you all just tried ignoring him? If he has eaten, has water available and has been let out to do his business, he does not seem to be in pain, etc. I would suggest you ignore him no matter how long he keeps that up. Does he get enough exercise like one or two good walks a day or a interactive play time in the yard?
You can try behavior/reward training, meaning he gets a reward for being
quiet. If he whines, ignore him. When he is quiet. Even for a couple of minutes, to start with, praise and reward. Few more minutes of being quiet, praise and reward. Whining will cause him to be ignored and no reward. Training dies not happen overnight and you have to be patient and consistent. Boxers can be very hard-headed. :-). A word of caution, if using this idea, only use very small pieces of food or even vegetables, if he will eat them.
Hope this might help.
Upkeep us posted.