Interestingly, in the Hebrew and the LXX the word translated “by lot” comes at the end of the sentence, and from position gives the appearance that it modifies the verb “commanded.” This, quite evidently, is not its intended function, however, and the KJV has properly adjusted its position so as to make it modify “gave.” The idea is that the Lord commanded Moses that disposition of the cities should be by lot.