Back to Blog

PAC Files (Proxy Auto-Config): Automatic Proxy Setup for Corporate Networks and Multi-Account Management

PAC files allow automatic traffic routing through the necessary proxy servers without manually configuring each device. We explain how it works and how to set it up for business.

📅August 4, 2026

If you manage dozens of accounts, work in a team, or want to flexibly route traffic through different proxy servers, manually configuring each browser or device becomes a nightmare. A PAC file solves this problem: one file with rules, and all traffic goes exactly where it needs to, automatically. In this article, we will explore what PAC files are, how they work, and how they are used by arbitrageurs, SMM specialists, and corporate users.

What is a PAC file and how does it work

A PAC file (Proxy Auto-Config) is a small file with the extension .pac, which contains a JavaScript function. This function receives the URL of each request and decides whether to send it directly or through a proxy server. If through a proxy, it determines which one to use.

The technology emerged in the 1990s in the Netscape Navigator browser and has since become a standard for corporate networks. Today, PAC files are supported by all popular browsers: Chrome, Firefox, Edge, Safari, as well as operating systems Windows, macOS, and Linux at the system settings level.

The principle of operation is simple: when a browser or application wants to load a page, it first executes the function FindProxyForURL(url, host) from the PAC file. The function returns one of three values:

  • DIRECT — connect directly, without a proxy
  • PROXY host:port — use HTTP proxy at the specified address
  • SOCKS5 host:port — use SOCKS5 proxy (supported in most modern browsers)

The most important thing is that you can specify multiple rules for different sites. For example, traffic to Facebook goes through one proxy, traffic to Wildberries through another, and everything else directly. This is what makes PAC files an indispensable tool for professional work with proxies.

💡 It's important to understand

A PAC file is not a program or a service. It is simply a text file with routing logic. The browser reads it and applies the rules on its own. No additional software is required.

PAC file vs manual configuration: what's the difference

Before diving into technical details, let's honestly answer the question: why complicate things if you can simply enter the proxy manually in the browser settings? The answer depends on the scale of your work.

If you have one account and one proxy, manual configuration is quite sufficient. But as soon as you start working with 10, 20, or 50 profiles, or when different sites require different proxies, manual configuration turns into a constant routine with a high risk of errors.

Criterion Manual Configuration PAC File
Number of profiles 1–5 (convenient) 10–1000+ (scalable)
Different proxies for different sites Not possible Easily configurable
Changing settings Manually on each device One file — everything updates
Backup proxy on failure No Can specify fallback
Corporate management Difficult to centralize One URL for the entire company
Entry threshold Zero Need to figure it out once

The conclusion is obvious: a PAC file is a tool for those who work with proxies professionally and at scale. If you are an arbitrageur managing multiple advertising accounts or an SMM agency with dozens of client accounts, a PAC file will save you hours of work every week.

Structure of a PAC file: how to read and write rules

Don't be intimidated by the word "JavaScript" — a PAC file does not require programming knowledge. It is literally just a few lines with understandable logic. Let's break down the basic structure with examples.

Any PAC file contains one mandatory function:

function FindProxyForURL(url, host) {
    // Your rules here
    return "DIRECT";
}
  

Function parameters: url — the full request address, host — only the domain. The function must return a string with the instruction.

Example 1: all traffic through one proxy

function FindProxyForURL(url, host) {
    return "PROXY 185.100.200.10:8080";
}
  

Example 2: Facebook and Instagram through a proxy, everything else directly

function FindProxyForURL(url, host) {
    if (shExpMatch(host, "*.facebook.com") ||
        shExpMatch(host, "*.instagram.com") ||
        shExpMatch(host, "*.fbcdn.net")) {
        return "SOCKS5 185.100.200.10:1080";
    }
    return "DIRECT";
}
  

Example 3: different proxies for different services + backup

function FindProxyForURL(url, host) {
    // Facebook Ads — through mobile proxy
    if (shExpMatch(host, "*.facebook.com") ||
        shExpMatch(host, "*.instagram.com")) {
        return "SOCKS5 mobile-proxy.example.com:1080; DIRECT";
    }

    // Wildberries and Ozon — through residential proxy
    if (shExpMatch(host, "*.wildberries.ru") ||
        shExpMatch(host, "*.ozon.ru")) {
        return "PROXY res-proxy.example.com:8080";
    }

    // Local network — always directly
    if (isInNet(host, "192.168.0.0", "255.255.0.0")) {
        return "DIRECT";
    }

    // Everything else — directly
    return "DIRECT";
}
  

Note the line SOCKS5 ...; DIRECT — the semicolon separates the main proxy and the backup option. If the main proxy is unavailable, the browser will automatically try the next option in the list.

The main built-in functions of PAC files that you will need:

Function What it does Example
shExpMatch(host, pattern) Checks the domain against a pattern *.facebook.com
isInNet(host, ip, mask) Checks if it belongs to a subnet 192.168.0.0 / 255.255.0.0
isLocalhost(host) Checks if the host is local To exclude localhost
dnsDomainIs(host, domain) Exact domain match dnsDomainIs(host, ".google.com")

Who needs PAC files and why: business scenarios

PAC files are not an abstract technology. Let's consider specific scenarios where they really save time and protect against blocks.

Arbitrageurs and Facebook Ads

A typical situation: an arbitrageur works with 15–30 Facebook ad accounts. Each account is linked to a separate profile in an anti-detect browser and a separate proxy. At the same time, traffic to Facebook.com, Instagram.com, and Meta services needs to go through a proxy, while services for work (Google Docs, Telegram, internal tools) operate directly.

A PAC file solves this with one file: you write rules for Meta domains — all traffic goes there through mobile proxies, which are less likely to raise suspicions with Facebook's algorithms. Everything else goes directly. One file works for all profiles at once.

SMM agencies and multi-accounting

An SMM specialist manages 30–50 client accounts on Instagram and TikTok. Each account must operate with a unique IP. When updating the pool of proxies (changing IP addresses), you need to update settings in all profiles — this takes hours of work.

With a PAC file: you place the file on a server (or even in Google Drive), and all profiles in Dolphin Anty or AdsPower refer to one URL. Update the file — settings change everywhere automatically. No manual profile adjustments needed.

Price monitoring on marketplaces

Sellers on Wildberries and Ozon regularly monitor competitors' prices. Marketplaces actively block scraping and frequent requests from a single IP. A PAC file allows you to configure requests to Wildberries.ru and Ozon.ru to go through residential proxies with rotation, while all other traffic goes directly. This reduces the load on proxies and traffic costs.

Corporate networks

In a corporate environment, PAC files are used for centralized management of employees' internet traffic. The IT department places the PAC file on an internal server, and all company computers receive it automatically via DHCP or Active Directory group policies. Traffic to internal resources goes directly, while external traffic goes through the corporate proxy with filtering and logging.

📌 Key advantage for business

A PAC file is a single point of control for traffic routing. Instead of updating settings on 50 devices or in 30 browser profiles, you change one file — and changes are applied everywhere automatically.

How to connect a PAC file in browsers and systems

A PAC file can be connected in three ways: via a local file path, via a URL on a server, or via the WPAD protocol (auto-discovery in corporate networks). Let's break down each option.

Windows — system settings

Proxy settings in Windows apply to all browsers that use system settings (Chrome, Edge, Internet Explorer):

  1. Open SettingsNetwork & InternetProxy
  2. Find the section Automatic proxy setup
  3. Turn on the Use setup script toggle
  4. In the Script address field, enter the path to the PAC file:
    • Local file: file:///C:/proxy/config.pac
    • Network file: http://server.company.com/proxy.pac
  5. Click Save

macOS — system settings

  1. Open System PreferencesNetwork
  2. Select the active network connection (Wi-Fi or Ethernet) → Advanced
  3. Go to the Proxies tab
  4. Check the box for Automatic proxy configuration
  5. In the URL field, enter the PAC file address
  6. Click OKApply

Firefox — separate settings

Firefox uses its own proxy settings, independent of system settings:

  1. Open Settings (or enter about:preferences in the address bar)
  2. Scroll down to the Network Settings section → click Settings
  3. Select Automatic proxy configuration URL
  4. Enter the URL of your PAC file
  5. Click OK

Where to store the PAC file

You have several options for storing the PAC file:

  • Locally on the computer — simple, but does not allow centralized updates
  • On a web server — ideal for teams, updates are applied instantly
  • On GitHub Pages or Gist — free hosting for small teams
  • In a corporate network — via WPAD (Web Proxy Auto-Discovery Protocol)

When hosting on a server, it is important to set the correct MIME type: the server must serve the file with the header Content-Type: application/x-ns-proxy-autoconfig. Without this, some browsers may refuse to process it.

PAC files in anti-detect browsers: Dolphin, AdsPower, GoLogin

For arbitrageurs and SMM specialists, the integration of PAC files with anti-detect browsers is especially important. Let's see how this works in the most popular tools.

Dolphin Anty

Dolphin Anty is one of the most popular anti-detect browsers among arbitrageurs. Setting up proxies via a PAC file is done at the profile level:

  1. Open Dolphin Anty and go to the desired profile
  2. Click on the profile edit icon
  3. In the Proxy section, select the connection type
  4. Select the Custom or PAC Script option (depends on the version)
  5. Paste the URL of your PAC file or the script content directly
  6. Save the profile and launch the browser

Important point: in Dolphin Anty, you can apply the same proxy settings to a group of profiles at once. This means that when changing the PAC file, you do not need to edit each profile manually — just update the file on the server.

AdsPower

AdsPower supports PAC files through browser profile settings:

  1. In the main menu, select the desired profile → Edit
  2. Go to the Proxy Settings section
  3. In the proxy type field, select Custom Proxy
  4. Set the connection type as PAC
  5. Enter the PAC file URL in the corresponding field
  6. Click Check Proxy for validation and save

GoLogin and Multilogin

GoLogin and Multilogin also support PAC scripts. In GoLogin, the setup is similar: in profile settings → proxy → select PAC type → paste the URL or script content. Multilogin, being a more corporate tool, has advanced proxy management capabilities through API, allowing for automation of PAC file assignments to new profiles.

⚡ Life hack for arbitrageurs

Create multiple PAC files for different tasks: one for working with Facebook Ads, another for TikTok Ads, a third for monitoring. This way, you can quickly switch proxy configurations for different teams or tasks by simply changing the script URL in the profile group.

Setting up PAC for a corporate network: step-by-step guide

Corporate use of PAC files is the next level. This is about centralized traffic management for the entire company: from 10 to several thousand devices.

Step 1: Define the routing logic

Before writing a PAC file, answer the questions:

  • Which resources should be accessible without a proxy? (internal services, intranet)
  • What external traffic needs to be routed through the corporate proxy?
  • Is filtering by categories of sites needed?
  • Which proxy to use as a backup?

Step 2: Create the PAC file

A typical corporate PAC file looks like this:

function FindProxyForURL(url, host) {

    // Local addresses — always directly
    if (isPlainHostName(host) || isLocalhost(host)) {
        return "DIRECT";
    }

    // Company's internal network — directly
    if (isInNet(host, "10.0.0.0", "255.0.0.0") ||
        isInNet(host, "172.16.0.0", "255.240.0.0") ||
        isInNet(host, "192.168.0.0", "255.255.0.0")) {
        return "DIRECT";
    }

    // Corporate domains — directly
    if (dnsDomainIs(host, ".company.ru") ||
        dnsDomainIs(host, ".company-internal.ru")) {
        return "DIRECT";
    }

    // All external traffic — through corporate proxy
    // With a backup option in case of unavailability
    return "PROXY proxy.company.ru:8080; PROXY proxy2.company.ru:8080; DIRECT";
}
  

Step 3: Host the file on a web server

Host the PAC file on the company's internal web server. Make sure that:

  • The file is accessible via a stable URL (e.g., http://proxy.company.ru/proxy.pac)
  • The server serves the correct Content-Type for PAC files
  • The URL is accessible from all devices on the network without authorization
  • Caching is set up with a reasonable TTL (e.g., 1 hour)

Step 4: Distribute settings via group policies

In a corporate environment with Windows and Active Directory, PAC file settings are distributed via GPO (Group Policy Objects):

  1. Open the Group Policy Management Editor (GPMC)
  2. Create a new GPO or edit an existing one
  3. Go to User ConfigurationWindows SettingsInternet Explorer Settings (or via the registry for Chrome)
  4. Specify the PAC file URL in the automatic configuration settings
  5. Apply the policy to the necessary departments

For Chrome in a corporate environment, a separate policy is used via Chrome ADMX templates: the ProxyPacUrl parameter allows you to forcibly set the PAC file URL for all installed Chrome in the domain.

Step 5: Configure WPAD for auto-discovery

WPAD (Web Proxy Auto-Discovery) is a protocol that allows devices to automatically find the PAC file without manual configuration. To do this, you need to:

  • Host the PAC file at http://wpad.company.ru/wpad.dat
  • Add a DNS record: wpad → IP of your web server
  • Enable the "Automatically detect settings" option on devices

With this setup, new devices on the network will automatically receive proxy configuration without any IT department intervention.

Common mistakes when working with PAC files and how to avoid them

Even experienced specialists make typical mistakes when working with PAC files. Let's discuss the most common ones.

Error 1: Syntax error in JavaScript

If there is a syntax error in the PAC file, the browser will silently ignore it and either work without a proxy or block all traffic. This is one of the most insidious problems — the error does not show up to the user.

Solution: Before deploying, check the PAC file through online validators (e.g., pacparser.io) or through DevTools in the browser. In Chrome, you can open chrome://net-internals/#proxy and see if the file was applied.

Error 2: Incorrect MIME type on the server

If the server serves the PAC file with Content-Type: text/plain or application/octet-stream, some browsers (especially Chrome) will refuse to apply it.

Solution: Configure the server to serve Content-Type: application/x-ns-proxy-autoconfig. For Apache, add to .htaccess: AddType application/x-ns-proxy-autoconfig .pac

Error 3: PAC file unavailable at browser startup

If the PAC file is hosted on a server that is unavailable when the browser starts (e.g., corporate server when working from home), the browser may hang while trying to load the page.

Solution: Always add a fallback option DIRECT at the end of the return line. Also, consider hosting the PAC file on a highly available platform (CDN, GitHub Pages).

Error 4: Forgot to include all subdomains

A common mistake: wrote a rule for facebook.com, but forgot about *.facebook.com, *.fbcdn.net, *.instagram.com. As a result, the main page goes through the proxy, while media files go directly. This creates mixed requests and potentially exposes the real IP.

Solution: For each platform, carefully study all the domains used. For Facebook, these are: facebook.com, *.facebook.com, instagram.com, *.instagram.com, fbcdn.net, *.fbcdn.net, whatsapp.com, *.whatsapp.com, and several others.

Error 5: Caching an old version of the PAC file

Browsers aggressively cache PAC files. After updating the file on the server, changes may not be applied immediately — the browser continues to use the old version.

Solution: Add versioning to the file URL when updating: proxy.pac?v=2. Or set caching headers on the server with a short TTL. In Chrome, you can force reload the PAC through chrome://net-internals/#proxy → Re-apply settings.

Problem Symptom Solution
Syntax error Proxy does not work at all PAC file validator
Incorrect MIME type Chrome ignores the file Set Content-Type on the server
Server unavailable Browser hangs Add DIRECT as fallback
Incomplete list of domains Real IP leak Check all subdomains of the platform
Caching Changes are not applied Versioning the file URL

Conclusion

PAC files are a powerful and underrated tool for anyone working with proxies professionally. Instead of spending time manually configuring each profile or device, you describe the traffic routing logic once — and everything works automatically.

For arbitrageurs, a PAC file means flexible traffic management for dozens of advertising accounts in Facebook Ads and TikTok Ads. For SMM agencies — centralized updates of proxy settings for all client accounts without manual work. For corporate IT departments — a single point of control for the internet traffic of the entire company through group policies.

Key takeaways from the article: a PAC file is a JavaScript function that determines which proxy to route each request through. It is supported by all browsers and operating systems. It can be centrally stored on a server and updated for the entire team at once. Anti-detect browsers Dolphin Anty, AdsPower, GoLogin, and Multilogin support PAC files at the profile level.

If you are configuring a PAC file for working with social networks or marketplaces, it is important to choose the right type of proxy. For tasks where simulating a real user is critical (Facebook Ads, Instagram, TikTok), residential proxies are optimal — they use IP addresses of real home users and raise suspicions with platform algorithms much less frequently. For mobile traffic and working with Meta advertising accounts, consider mobile proxies, which emulate connections through mobile operators.