Connecting to a different data center

Hello guys, I would like to connect myself to a different data center (country). How can I do it on the PAC file? For example, I’m located in Seattle but I want to get IP of a European country. So, once I run ZCC it connects me to a DC in Germany. Thanks for help

Hi Brian,

Quick question: what mode are you using? Tunnel, tunnel with local proxy or tunnel v2?

Hi Pablo, thank you for responding. It’s V1.0 tunnel

Hi Brian,

Thank you for the response!

In that case, for tunnelv1, on the App Profile’s pacfile, you can write it using the return statements.

By default, you’ll have something like this at the end of the pacfile:

return "PROXY ${GATEWAY_FX}:80; PROXY ${GATEWAY_FX};DIRECT";

This return statement tells the agent to connect to the nearest node. So you have two choices.

If you with the send to another ZEN some urls, just write something like this on the pacfile (before the last statement of course):

   if (((dnsDomainIs(host, "onedomain.com")) ||
            (dnsDomainIs(host, ".seconddomain.com")) ||
            (dnsDomainIs(host, ".thirddomain.com")))
     return "PROXY [firstnode]:80; PROXY [secondnode]:80";

You can use several pacfile functions to declare the domains, I use dnsDomainIs because It’s easy and you can select one domain (onedomain.com) or domain and all subdomains (.onedome.com ← check the first dot)

How do you locate what to put on [firstnode] and [secondnode]? you have to go to https://config.zscaler.com/[yourcloud]/cenr (example: Config | Zscaler), check the column Proxy Hostname of the location you want (for example, Spain on zscaler.net would be Madrid III so mad3.sme.zscaler.net, and for secondary node if that one doesn’t work maybe Paris par2.sme.zscaler.net). If we use this example, we would have:

   if (((dnsDomainIs(host, "onedomain.com")) ||
            (dnsDomainIs(host, ".seconddomain.com")) ||
            (dnsDomainIs(host, ".thirddomain.com")))
     return "PROXY mad3.sme.zscaler.net:80; PROXY par2.sme.zscaler.net:80";

If you wish to know more about writing pacfiles you can check our best practice: Best Practices for Writing PAC Files | Zscaler

Hope it helps! You can try to use some domains like maybe whatismyip.com so that you can find which IP are you using to get to the site, to check if your pacfile is working.
Also, remember to refresh policy on the agent after editing the pacfile and activating the change so it gets the new config