If you need them to be the same, copy the canonical one to the non-canonical one. If you need to know how they differ, and they are guaranteed to have the same order, use diff or something similar.
One way I might do it by hand if I felt I had to is to make a hash of hashes, parse the first file into it, where the host aliases were all keys and their values were say, -1, and then read the second file and add 1 to the value of %hash{hostid}{alias}. This gives you 0 if it's in both, -1 if it's in only the first file, and 1 if it's in only the second file.