This project is not covered by Drupal’s security advisory policy.

Provides a service that uses a simple database query to geo locate an IPv4 or IPv6 address. It is highly performant in that it can be used to query the IP address on every single page load. It uses a single indexed query to do this.

This module only provides a service, it does nothing else. To use, you can add kernel onRequest event subscriber and then query the service to get the current country/timezone and do whatever you want with it.

This module currently downloads the CSV file into the database from the ip2location.com commercial service. It could be improved to support all the ip2location products or any other service. The download is done on cron. Updated files are downloaded monthly per ip2location.com's publication schedule. It can also be done by drush.

Related Drupal 8 modules

  • smart_ip is more versatile than this module in that it supports multiple services. However it treats each service as a black box rather than a data source, and thus the lookup must read from a large data file. It's the large data files that ultimate lead to the development of this module, Pantheon wouldn't support them. The performance issues of large data files were somewhat mitigated by the use of shared memory in the ip2location API code.
  • ip2country does not handle timezones.
  • hostip uses a services, not suitable for looking up every user page or even every session.

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Module categories: Site Structure
  • Created by douggreen on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases