Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Mar 1 '11 at 16:31

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

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

2 Answers 2

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

 
discard

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