> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pangolin.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable ASN Lookup

> Configuration requirements to enable ASN lookup features in Pangolin

<div id="pangolin-toc-cta" className="pangolin-toc-cta-source">
  <Card title="Try free on Pangolin Cloud" icon="cloud" href="https://app.pangolin.net/auth/signup" arrow="true" cta="Sign up free">
    Fastest way to get started with Pangolin using the hosted control plane. No credit card required.
  </Card>
</div>

Pangolin uses an ASN database to map request IP addresses to autonomous systems, such as cloud providers, residential ISPs, VPN providers, and corporate networks. That ASN data powers ASN access rules and ASN blocking patterns.

To enable ASN lookup features in Pangolin self-hosted, download the MaxMind ASN database, place it in the `config/` directory, and point Pangolin at the database file. This can be done for free.

<Tip>
  Remember to keep the ASN database updated regularly, as ASN assignments and network mappings can change over time. You can just repeat the download and extraction steps periodically to ensure your database is current.
</Tip>

<Tip>
  You can automate this process with a MaxMind Docker container. See the [GeoLite2 Automation community guide](/self-host/community-guides/geolite2automation) for an example.
</Tip>

## Install with the Installer

You can use the installer to download and place the database for you. Download the latest installer:

```bash theme={"theme":"gruvbox-light-hard"}
curl -fsSL https://static.pangolin.net/get-installer.sh | bash
```

Then run the installer again:

```bash theme={"theme":"gruvbox-light-hard"}
./installer
```

## Manual Installation

<Steps>
  <Step title="Download and extract the ASN database">
    Download and extract the GeoLite2 ASN database using the following commands:

    ```bash theme={"theme":"gruvbox-light-hard"}
    # Download the GeoLite2 ASN database
    curl -L -o GeoLite2-ASN.tar.gz https://github.com/GitSquared/node-geolite2-redist/raw/refs/heads/master/redist/GeoLite2-ASN.tar.gz

    # Extract the database
    tar -xzf GeoLite2-ASN.tar.gz

    # Move the .mmdb file to the config directory
    mv GeoLite2-ASN_*/GeoLite2-ASN.mmdb config/

    # Clean up the downloaded files
    rm -rf GeoLite2-ASN.tar.gz GeoLite2-ASN_*
    ```
  </Step>

  <Step title="Update the Pangolin config file">
    Update your Pangolin configuration to point to the new ASN database file. Edit `config/config.yml` to include the following entry:

    ```yaml theme={"theme":"gruvbox-light-hard"}
    server:
      maxmind_asn_path: "./config/GeoLite2-ASN.mmdb"
    ```
  </Step>

  <Step title="Restart Pangolin">
    Restart your Pangolin instance to apply the changes:

    ```bash theme={"theme":"gruvbox-light-hard"}
    docker compose restart pangolin
    ```
  </Step>
</Steps>

Alternatively, you can create an account at [MaxMind](https://www.maxmind.com/en/geolite2/signup) to get a license key and download the database directly from them.

<Note>
  After the ASN lookup database is enabled, use [access control rules](/manage/access-control/rules) or the [ASN Blocking](/manage/asnblocking) guide to create blocking or allow rules.
</Note>
