updateHostsFile.py can handle either simply combining local hosts files you have checked in, or it can go out to the Internet to update your source files. It also handles automatically generating a header and removing duplicates from the list.