One look at the dictionary will tell you that the meanings of these two words are deeply entwined; in many common cases (as in your examples), however, they are essentially synonymous, and I find both of your sentences quite natural, standing as they do out of context. I suppose that know usually carries the meaning of having already fixed information in one's mind ( Do you know all the capitals of the US states? ), while understand suggests comprehending the reality of the situation ( Do you understand that I really have a headache tonight and just want to go to sleep?
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.