Any user can create a personal list of hosts to complement the entries in the /etc/hosts file.
The functionality is implemented in glibc. You can define a custom hosts file by setting the
HOSTALIASES
environment variable. The names in this file will be picked up bygethostbyname
(see documentation).Slightly edited from: Can I create a user-specific hosts file to complement /etc/hosts? – Unix & Linux Stack Exchange$ echo 'g www.google.com' >> ~/.hosts $ export HOSTALIASES=~/.hosts $ wget g -O /dev/null