Why proxy server don’t use the ip in client hosts file but do dns query

hostsPROXY

A website changed DNS server,unable to get the correct ip with the normal dns query.
So I have to write domain&ip to etc/hosts (macOS).
I can only access this site faster if I use a proxy.
Local hosts file seem to be ignored when use a proxy , and the proxy server does't belong to me .
Why proxy server don't use the ip in client hosts file but do dns query?
Is it a paradox to use a proxy and a hosts file at the same time?

The proxy client is acting as a transparent proxy on the router.
When I use Wireshark,the destination ip is the one I filled in hosts.

Best Answer

As proxy is not managed by you it's hard to understand what is the situation there. But This server (with proxy) have and use own resolv mechanism and have no idea about your /etc/hosts file.

You can create own proxy server which forward requests to external proxy for particular hosts and work only for your local machines.

As per edit: you can try to update hosts file on the router to make resolv of local hosts faster.

Related Topic