From another thread here it was brought up about Magog, didn't want to derail that because there's much to look into.
We first find it in Genesis in the genealogy found there after the flood.
1 Now this is the genealogy of the sons of Noah: Shem, Ham, and Japheth. And sons were born to them...