1

I want a forward proxy that basically overrides DNS like /etc/hosts would on a client machine. So when People go to Google.com (for example) the proxy sends the request to a specified IP address. I assume this can be done with Squid, can someone point me in the right direction? It is only a handful of URLs that I need to manage, everything else should be passed through to the actual server.

The purpose of this is to point some groups to a UAT environment so they can test some migrated web sites, it seems easier than managing all of their hosts files. Clients are Mac, Servers are RHEL 6

1 Answer 1

1

Normally the proxy server does the resolving (at least for plain HTTP, although I'm not 100% sure about HTTPS) so you simply point your proxy to a customized DNS server. In Squid with the configuration directive dns_nameservers.

The clients need to be explicitly configured to use the proxy.

DNSmasq is relatively light weight DNS server that can use a hosts file as the configuration syntax so you do not need to configure a complete zone for each domain you'll be spoofing.

3
  • 1
    The proxy (if specified as an explicit proxy) does do the DNS lookup for both HTTP and HTTPS. The only caveat here would be the complaints from your browser (which may be fatal to some browsers!) if you try to redirect HTTPS traffic for, say, facebook. You can also rewrite urls with a squid ACL.
    – Tom Newton
    Jul 1, 2014 at 15:30
  • Can I forgo DNS by using a hosts file on the proxy server and pointing nsswitch to use files for DNS/hosts first? Jul 1, 2014 at 15:43
  • @usedTobeaMember depends on the proxy server you use, and how you configure it, but yes, that should be possible.
    – Zoredache
    Jul 1, 2014 at 17:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .