# Configure MAXMIND for reverse IP lookups

**URL:** https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941
**Category:** Sysadmins
**Tags:** how-to, maxmind
**Created:** [December 21, 2020, 5:58pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941 "2020-12-21T17:58:35Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 21, 2020, 5:58pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/1 "2020-12-21T17:58:35Z")

</div>

### What is MAXMIND and why would I want it?

Discourse uses [MAXMIND](https://www.maxmind.com/en/home) to provide geographical information for reverse IP lookups.

 ![location](https://global.discourse-cdn.com/meta/original/3X/8/9/89320702b7104755c7be2e1634e9a00541deb718.png)

Without Maxmind’s database you’ll see something like this:

 ![nolocation](https://global.discourse-cdn.com/meta/original/3X/c/e/ce976d9097cd622df15607b4d51417c378933f3e.png)

Or perhaps you’ve noticed this message fly by when you rebuild your container:

```plaintext
MaxMind IP database download requires an account ID and a license key
Please set DISCOURSE_MAXMIND_ACCOUNT_ID and DISCOURSE_MAXMIND_LICENSE_KEY. See https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941 for more details.

```

### Why would I care?

It’s often useful for moderators to see where someone is logging in from to determine if the person is who (and where) they say they are or to diagnose problems with your site. (“Oh, we frequently see problems with `Special-ISP`”.)

Also, as of [2.2.0.beta4](https://meta.discourse.org/t/discourse-2-2-0-beta4-release-notes/101272), Discourse also uses this information to notify admins if a login is seen from a new location. Without the Maxmind database, Discourse cannot provide this notification.

### What if I don’t setup a MaxMind account and generate a license key

You won’t be able to do reverse lookups. If the issues above do not concern you, then it is a good bet that nothing bad will happen if you just ignore this.

### How do I setup a MaxMind account and obtain an Account ID and a license key?

See Maxmind’s [Generate a license key](https://support.maxmind.com/hc/en-us/articles/4407111582235-Generate-a-License-Key) page for up-to-date instructions, but you need to

- Visit the [GeoLite2 Sign Up](https://www.maxmind.com/en/geolite2/signup?utm_source=kb&utm_medium=kb-link&utm_campaign=kb-create-account) page.
- generate a license key on the Manage License Keys tab in the left navigation bar once you’ve logged in. Generate a new key, and copy the account ID and the license key. If you lose it, you’ll need to generate a new one.

You then add that key to the ENV section of your `app.yml` with a line like this:

```
  DISCOURSE_MAXMIND_ACCOUNT_ID: your-account-id-here
  DISCOURSE_MAXMIND_LICENSE_KEY: your-key-here

```

Or via `discourse-setup` when prompted.

### Notes for IPv6 users

The [Standard install](https://meta.discourse.org/t/142537?silent=true) doesn’t fully support IPv6 out of the box. If you have a server with IPv6 configured and need Maxmind information for IPv6 addresses, you’ll need to make sure that the user’s actual IP address is what is getting to Discourse, normally by using an external proxy that passes the remote IP address to Discourse. This requires more systems administration expertise than the [standard install](https://meta.discourse.org/t/142537?silent=true).

---

<div class="post-metadata">

### Author: ![evert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evert/32/300908_2.png) [@evert](https://meta.discourse.org/u/evert)
#### Post date: [May 14, 2024, 8:41am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/28 "2024-05-14T08:41:00Z")

</div>

@pfaffman , the URL to ‘My License Keys’ contains your account ID at MaxMind and therefore won’t work for anyone but you 😉

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 14, 2024, 8:52am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/29 "2024-05-14T08:52:25Z")

</div>

Works for me! 😜

What’s funny, though is that no one else has complained in 3 years! It’s a wiki, so you can fix it. I’ll try to update when I get to a computer if I can manage to remember.

---

<div class="post-metadata">

### Author: ![evert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evert/32/300908_2.png) [@evert](https://meta.discourse.org/u/evert)
#### Post date: [May 14, 2024, 9:00am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/30 "2024-05-14T09:00:31Z")

</div>

Shows how many people actually read pages likes these 😁

I’ve edited the page 🤓

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 14, 2024, 9:02am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/31 "2024-05-14T09:02:03Z")

</div>

> [@evert](#):
>
> Shows how many people actually read pages likes these

Right!? And I spent a fair amount of time creating it. Not sure how I missed that the link worked just for me, but I guess having to log in was enough to distract me and maybe lots of other people.

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [May 14, 2024, 10:34am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/32 "2024-05-14T10:34:38Z")

</div>

> [@pfaffman](#):
>
> [Manage License Keys]

Just a curiosity question @evert, did you mean to leave the brackets there? If so, would it perhaps look better as a button?

> **Button example**
>
> Manage License Keys
> 
> ```html
> <kbd>Manage License Keys</kbd>
> 
> ```

---

<div class="post-metadata">

### Author: ![evert](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evert/32/300908_2.png) [@evert](https://meta.discourse.org/u/evert)
#### Post date: [May 14, 2024, 11:18am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/33 "2024-05-14T11:18:39Z")

</div>

Sure, why not? 👍🏻

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [May 29, 2024, 11:21am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/34 "2024-05-29T11:21:00Z")

</div>

So far as I can tell I’m good to go

![image](https://global.discourse-cdn.com/meta/original/4X/4/5/0/450b2717c01848a70694a046236a54261d56c89b.png)

but all users show location “unknown”

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/3/2/83204ab5d7b8df0bbd6708bd145c0f5a277ee13c.png)

Any help is appreciated.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [May 29, 2024, 11:59am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/35 "2024-05-29T11:59:47Z")

</div>

You need to remove the # character in front and rebuild. The # character makes the entire line a comment in the YAML file.

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [May 29, 2024, 12:35pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/36 "2024-05-29T12:35:35Z")

</div>

Thank you, just write out and exit or rebuild too?

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [May 29, 2024, 2:18pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/37 "2024-05-29T14:18:05Z")

</div>

You have to rebuild. Discourse won’t see `app.yml` changes otherwise.

---

<div class="post-metadata">

### Author: ![anon48433008](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@anon48433008](https://meta.discourse.org/u/anon48433008)
#### Post date: [May 29, 2024, 2:53pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/38 "2024-05-29T14:53:01Z")

</div>

Thank you, done and working 🤗

---

<div class="post-metadata">

### Author: ![Octoberon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/octoberon/32/288382_2.png) [@Octoberon](https://meta.discourse.org/u/Octoberon)
#### Post date: [May 29, 2024, 6:08pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/39 "2024-05-29T18:08:24Z")

</div>

> [@pfaffman](#):
>
> Also, as of [2.2.0.beta4](https://meta.discourse.org/t/discourse-2-2-0-beta4-release-notes/101272), Discourse also uses this information to notify admins if a login is seen from a new location. Without the Maxmind database, Discourse cannot provide this notification.

It probably goes without saying for most here, but someone using a VPN may generate more alerts than others. It’s a nudge for the admins but doesn’t necessarily indicate a nefarious user.

---

<div class="post-metadata">

### Author: ![eisammy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eisammy/32/528804_2.png) [@eisammy](https://meta.discourse.org/u/eisammy)
#### Post date: [May 29, 2024, 7:42pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/40 "2024-05-29T19:42:18Z")

</div>

Perfect! thank for this tutorial.

---

<div class="post-metadata">

### Author: ![b89k57w62](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/b89k57w62/32/514827_2.png) [@b89k57w62](https://meta.discourse.org/u/b89k57w62)
#### Post date: [June 19, 2025, 1:18pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/41 "2025-06-19T13:18:26Z")

</div>

Excuse me,  
When Discourse performs an IP lookup (reverse-IP) for the admin panel, does it rely on an **offline GeoIP database** or does it query an **external API** each time?

thanks!!

---

<div class="post-metadata">

### Author: ![b89k57w62](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/b89k57w62/32/514827_2.png) [@b89k57w62](https://meta.discourse.org/u/b89k57w62)
#### Post date: [June 19, 2025, 1:19pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/42 "2025-06-19T13:19:48Z")

</div>

For context, my preference is to handle IP lookups **offline** by pointing Discourse to a local **GeoLite2-City.mmdb** file, rather than calling an external API.

---

<div class="post-metadata">

### Author: ![eisammy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eisammy/32/528804_2.png) [@eisammy](https://meta.discourse.org/u/eisammy)
#### Post date: [June 23, 2025, 7:49pm UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/43 "2025-06-23T19:49:04Z")

</div>

Yet not support to IPV6? maybe be time to redirect this traffic to v4 ):

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [November 7, 2025, 12:40am UTC](https://meta.discourse.org/t/configure-maxmind-for-reverse-ip-lookups/173941/44 "2025-11-07T00:40:55Z")

</div>

(Deleting my question here and posting in Support: [MaxMind 401 error – have license key, can’t download](https://meta.discourse.org/t/maxmind-401-error-have-license-key-cant-download/388284))
