Skip to content
/ hosts Public
forked from figiel/hosts

a libc wrapper providing per-user hosts file

Notifications You must be signed in to change notification settings

belaz/hosts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hosts - wrapper for libc which provides defining host aliases in a per-user file

note:

 - if your libc does support it you may want to set HOSTALIASES instead of
   using this wrapper, see gethostbyname(3).

compilation:

$ git clone https://github.com/figiel/hosts.git
$ cd hosts
$ make

installation (example for bash):

$ mkdir ~/bin
$ cp libhostspriv.so ~/bin
$ echo 'export LD_PRELOAD=~/bin/libhostspriv.so' >> ~/.bashrc
$ logout

usage:

$ echo "127.0.0.1 new_name" >> ~/.hosts
$ nc -vz new_name 80

limitations:
 - doesn't work with suid programs for obvious reasons, that includes ping
   unfortunately.

feedback:
 - if you've found any bugs, feel free to fork & request a pull with patch

About

a libc wrapper providing per-user hosts file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.1%
  • Makefile 4.9%