Thursday, March 26, 2009

[MOSS2007] SharePoint removes entries from hosts file with multiple entries on one line

[SITUATION]
The SharePoint environment consists of three servers, a web front end, an index/central admin and a database server. According to Microsoft Best Practices, we have activated the Web Application role on the index server as well and configured the index server to use the local server. SharePoint does this by modifying the HOSTS file.

[ISSUE]
Last week a colleague noticed that some entries in the hosts file were periodically removed. After some investigation, he found out that this only happens with entries where multiple hostnames are linked to one IP address, for example:
  • 127.0.0.1<tab>server.domain.intra<tab>server
All entries that had only one server name in each line, remained in the hosts file.

[SOLUTION]
To get around this issue we changed the following line:
  • 127.0.0.1<tab>server.domain.intra<tab>server
into:
  • 127.0.0.1<tab>server.domain.intra
  • 127.0.0.1<tab>server
After this change, SharePoint left the entries alone.

1 comment:

PlateSpinner said...

It's rewriting the hosts file because that host is set to be the only server indexing your content (set in Office SharePoint Server Search service settings). What I recommend is setting that setting to use all servers and then go and change the hosts file yourself. (Use the names that are in your "Content Sources" of your SSP search settings.)