PACfile Help

gusgizmo

Ars Praefectus
3,057
Subscriptor
Even myIpAddress() isn't super reliable. Think issues like returning the loopback address, or thinking that it's IP is on X range (provided by some random soho router) when really they are coming in on remote access vpn on Y range. I had better success with writing logic into the web server hosting the proxy.pac file to get the requesting hosts IP, then returning the correct configuration. Wouldn't be too much harder to turn that into a hostname, but that would depend on reliable reverse DNS.
 

Dilbert

Ars Legatus Legionis
34,009
Just out of curiosity, can you explain why you want to do this/what it is you want to accomplish?

I'm thinking there is going to be a much simpler solution than the one you propose.

In short, what is the goal and what problem does it solve?
This.

Any apparent gruntwork-like solution pissed someone off 10+ years ago and they published an RFC that solves it more gracefully. Now it is established standard.
 

Frennzy

Ars Legatus Legionis
85,841
You're telling us that you perceive a solution* to a problem you haven't defined. We need to know the problem. *Why* do these certain PCs need to use a different proxy? *Why* can't you differentiate by IP? Perhaps you should consider VLANing them off on their own subnet? Have you considered using DHCP reservations to maintain certain addresses for certain machines?

*And apparently you can't do the perceived solution.

It actually might work if you're using DDNS, and the following PAC file entry

localHostOrDomainIs(host, hostdom)
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
There are some specific domains within our environment that cannot be segmented out by IP address as I do using the inNet and MyIPAddress for other specific users or groups.

So, the question is how do I filter on the PC DNS name to say if *.tom.com return proxy "tom" else return proxy "default'
Personally I would not do it this way. If you have domain based management (I'm assuming MS Active Directory based domain, or even just LDAP with group management), there are a lot of great options out there for web access management and filtering that integrate that level of user management so you can let a user (as a member of a group) have a certain level of web access or VPN access or whatever tied to their user account, not the PC they log into. That way they have a consistent experience no matter where they log in, rather than having to hop from one PC to another to get what they need/want.

Otherwise, you can explain why you want to have certain PCs that can't be delimited any other way act differently than certain other PCs with no additional segmentation.
 

tmkuzma

Seniorius Lurkius
4
Unless I am missing the point of you message. If there is a way in AD to assign a proxy that may work but, I am not aware of that.

The need is to route a specific dns domain to another set of proxies. Lets just say there is a split of groups and a domain name was added but because of some sub-netting issues the are shared IP addresses. My job is to try and route this new domain to a specific proxy and make this happen within the PACfile.

I need a way to grab the PC name and if it matches a specific domain
 

Frennzy

Ars Legatus Legionis
85,841
. If there is a way in AD to assign a proxy that may work but, I am not aware of that.

Of course there is. GPO.

And did you miss the PACFile entry I mentioned earlier?


edit: For anyone else reading this...we see this fairly often around here. Someone comes in and asks how to do "X", as they presume it's the only solution to a problem. If they would simply state a problem and then ask for potential solutions, things would go a lot better...because I can guarantee that *someone*, *somewhere*, has already solved the problem...and likely in ways you may not have thought of.
 

dodexahedron

Ars Praefectus
3,368
Subscriptor++
Well...Yeah...If we're just basing this on ways you can do it, then why hasn't someone pulled out the big guns and suggested a WCCP-based solution?
Right. Because management of domain-joined Windows machines via group policy is a trivial answer to the problem presented.

The need to traverse different proxies to hit different application instances is an internal implementation detail that is far from universal, since there are lots of ways of solving that problem, too1.

/s (but really tho) :eng101: :facepalm: :p


1: One option, for example, is to use different URLs to hit the appropriate server. Also, if the proxy is performing some necessary function for the application, it's not a proxy in the sense of this question - it's a proxy-ish thing that is part of your application, in practice, even if your team doesn't own that part of it. Otherwise, I'm coming up short on legitimate reasons to do this.