Configure MAXMIND for reverse IP lookups | How to configure MAXMIND for reverse IP queries in Discourse

:warning: [Configuration MAXMIND, Discourse requires a rebuild, which will cause service interruption.]


What is MAXMIND and why do we need to use this service?

Discourse uses MAXMIND to reverse query the specific physical address through IP addresses.


If Discourse is not configured with Maxmind’s database, the configuration information we see is as follows:


Or when recompiling the Discourse container, you will see the following information:

MaxMind IP database updates require a license
Please set DISCOURSE_MAXMIND_LICENSE_KEY to one you generated at https://www.maxmind.com

Why do we need to query IP addresses?

We usually use IP address queries to understand the addresses of users accessing the system, who these users are, and where they are accessing our website from. If there are problems, you can also find out that these users Special-ISP" frequently visit my website.

Starting with Discourse 2.2.0.beta4, Discourse also uses this IP address information to notify administrators of new login addresses accessing your website.

If you do not configure the Maxmind database, Discourse cannot provide the above information to the administrator.

What are the problems if I don’t have this Key?

If you are not very concerned about the issues mentioned above, then it doesn’t matter if you don’t configure the maxmind database.

The worst-case scenario is that you will not be able to receive notifications of new IP address user access and query specific user IP address information.

Of course, you can also copy the IP address to other open networks for querying.

How to get the Key

Please refer to Maxmind’s Generate a license key website page for an article on how to create a Key.

  • Visit the GeoLite2 Sign Up page.
  • Create a Key on the “My License Keys” link page. You need to save the created Key. If the Key is lost, you will need to create a new Key.

Add the Key you obtained to the ENV environment variable in app.yml. The configuration file should look like this:

  DISCOURSE_MAXMIND_LICENSE_KEY: your-key-here

Or configure it through discourse-setup.

IPv6 User Instructions

Discourse’s default installation method does not fully support IPv6.

If your server is configured with IPv6, you need to ensure that Discourse can obtain the user’s real IPv6 address.

This can usually be achieved by setting up a reverse proxy in Discourse, which usually requires more administrator configuration.

1 Like