Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a very curious problem on my RedHat linux Server. I have a Squid proxy server installed and operating wonderfully for WAN addresses. However when I try to access my local MediaWiki system I get

The requested URL could not be retrieved
The following error was encountered: Unable to determine IP address from host name for ServerName

When I restart squid I am able to access these local addresses for about 5 minutes, but then this same message comes back. Now I have verified that I can ping ServerName just fine, so the name resolution isn't actually the issue.

I have also added the lines to my squid.conf, which all the instructions I find online seem to indicate should solve the issue.

acl ServerName dstdomain DomainName
always_direct allow ServerName

(NOTE: Names have been changed to protect the innocent)

I then also added:

acl MyDomain src 192.168.0.1/255.255.255.192
never_direct deny MyDomain

Same result (And there was some weird message from aclParseIpData warning me about my netmask making away part of my specified IP), which I thought was a very odd message indeed.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

The right answer for this was to modify my proxy.pac, and wpad.dat files. Instead of just saying:

function FindProxyForURL(url,host)
{

 return "PROXY 192.168.0.XX:3128; DIRECT";
}

instead I have to modify it so when machines saw that it was a local machines host name and not a URL they didnt try to use the proxy. The isPlainHostName function worked perfectly. The code I used is:

function FindProxyForURL(url,host)
{
  if(isPlainHostName(host))
        return "DIRECT";

  return "PROXY 192.168.0.XX:3128; DIRECT";
}

It was just me being ignorant of how to properly use the .pac file to direct users to local addresses.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.