Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anybody knows if there is an utility that enable/disable the "hosts' file"

share|improve this question

migrated from Mar 1 '11 at 16:31

This question came from our site for professional and enthusiast programmers.

on which os? linux? windows? server? client? why? – rene Mar 1 '11 at 16:19
Bad idea as many software depends on localhost which is defined in the hosts file. – Bassie Mar 1 '11 at 16:29
Anyone with access to write to the hosts file will have access to undo this. – James L Mar 1 '11 at 16:57

In UNIX you can use nsswitch. Default:

hosts:          files dns

If delete files:

hosts:          dns

/etc/hosts will not work

share|improve this answer

What OS? In windows you can rename the file using a basic batch command, or your scripting language of choice. I've also noticed that Windows will cache DNS resolution, so you'll also need to run "ipconfig /flushdns" afterwards.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.