Good advise above- try to medicate before meals and wait it out (if it is teething) and play around with timing if he is not hungry at dinner time.
We all go through this. I have an almost 19 mo and a 4.5 yo that is a light eater, so dinners can be an issue. Nothing more disheartening that working hard to make something and having it not eaten. Not sure about you, but I then have to contend with DH's strong opinions about them "eating what we have made or nothing at all". Personally, I don't like to set everyone up for failure like that. Perhaps you can find some middle ground by offering one thing that you know he likes. That way, you get something into him, but don't go so far as to cook another meal for him.