Link to home
Start Free TrialLog in
Avatar of ThorinO
ThorinOFlag for United States of America

asked on

Can I use Squid be used to change the IP for a requested URL?

If (live) is is it possible to configure squid so that when is requested it actually goes to and maintain the host header?

If so can you please describe in detail (link) or config files?
Avatar of Craig Beck
Craig Beck
Flag of United Kingdom of Great Britain and Northern Ireland image

You could try adding an entry to the /etc/hosts file on the Squid box.

The file should be formatted as follows:
Avatar of ThorinO


That is an good idea, I did not think of that, I wonder if it would be that easy. I will need to setup a Squid box and test. Will report back later.
Avatar of ThorinO


Unfortunately it does not work, when I ping the domain from the console it returns the correct IP. However when connecting to the proxy using a browser I go to the incorrect IP.
What version of Linux are you using?
Avatar of crazedsanity
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ThorinO


You are correct and I am almost there. The link you gave me got me on the right track but those configs are for v2 of Squid, I am currently using v3.1. The syntax can be found here:

Now I need to configure it so it only allows what I have listed and denies everything else so people can't use it as a proxy for whatever they want. I also need to configure authentication so add additional security.