Score:0

use hosts file with proxy

cn flag

It is obvious that local /etc/hosts file is ignored when using a proxy while browsing. How can I use hosts file when using a proxy? I've access to the proxy server. I changed /etc/hosts file on the proxy server itself, it did work when I use a browser from the the proxy itself, although it didn't work at all for all the clients connecting through it. It is totally ignored.

from the proxy server (running proxidize.com)

/etc/nsswitch.conf

passwd:         files
group:          files
shadow:         files
gshadow:        files

hosts:          files mymachines dns myhostname
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

/etc/resolv.conf

nameserver 1.1.1.1
nameserver 1.0.0.1

/etc/hosts

ip_address www.website.com

when opening www.website.com from a browser from the same proxy box, it is resolving using /etc/hosts file, but this hosts file is ignored for all connections using the proxy server

How can I force all proxy users to use the hosts file of the proxy?

Score:0
us flag
Rob

In the common Squid proxy for example you can enable/disable the system default and/or select an alternative hosts file with the hosts_file option. You will also need to restart Squid to pick up any changes in that hosts file as it is only processed during Squid startup.

See: http://www.squid-cache.org/Doc/config/hosts_file/

In other proxy servers things may work differently or similar.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.