Skip to content

Set 'files' as the only source for name resolution for 'hosts' in nsswitch.conf

License

Notifications You must be signed in to change notification settings

youssefeldakar/hostsfilesonly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hostsfilesonly

On a glibc system, in /etc/nsswitch.conf, for the 'hosts' database, assuming 'files' is the first source listed, comment out everything else if the argument to the 'hostsfilesonly' script is '1' or undo this if the argument is '0'. Besides that, the 'pause' script does the following: execute the 'hostsfilesonly' script with argument '0', wait for the amount of time indicated by the argument to the 'pause' script as defined by 'sleep(1)', execute the 'hostsfilesonly' script with argument '1', then kill all 'firefox' instances. Both scripts require root privilege, which may be configured as in the sample 'hostsfilesonly.sudoers' file..

This is useful as a very rudementary way for turning on/off browsing on a PC.

About

Set 'files' as the only source for name resolution for 'hosts' in nsswitch.conf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages