Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxmouchet/mmdb-whois-server
Serve MMDB files over the WHOIS protocol.
https://github.com/maxmouchet/mmdb-whois-server
ip-geolocation mmdb whois
Last synced: 16 days ago
JSON representation
Serve MMDB files over the WHOIS protocol.
- Host: GitHub
- URL: https://github.com/maxmouchet/mmdb-whois-server
- Owner: maxmouchet
- License: mit
- Created: 2024-03-31T11:37:42.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-03-31T13:09:26.000Z (9 months ago)
- Last Synced: 2024-12-01T12:47:19.978Z (22 days ago)
- Topics: ip-geolocation, mmdb, whois
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mmdb-whois-server
Serve MMDB files over the WHOIS protocol.See the following post for more information: https://community.ipinfo.io/t/create-a-whois-server-from-scratch/5574
## Usage
First download an MMDB file, for example the free [Country & ASN database](https://ipinfo.io/products/free-ip-database) from [ IPinfo](https://ipinfo.io):
```bash
ipinfo download country-asn -f mmdb
```Then install the dependencies and run the server:
```bash
poetry install
# Use a non-privileged port instead of 43 so that we don't need to be root.
poetry run mmdb-whois-server --port 8043 country_asn.mmdb
```Alternatively, you can use Docker:
```bash
docker run --rm -it -p 8043:43 -v $(pwd):/data \
ghcr.io/maxmouchet/mmdb-whois-server:main /data/country_asn.mmdb
```Finally, query the server:
```bash
whois -h localhost -p 8043 -- 1.1.1.1
# as-domain: cloudflare.com
# as-name: Cloudflare, Inc.
# asn: AS13335
# continent: OC
# continent-name: Oceania
# country: AU
# country-name: Australia
```## Public server
An instance of this server is hosted over IPv4 and IPv6 at `whois.dscp.dev` and serves the free Country & ASN database, updated daily:
```bash
whois -h whois.dscp.dev -- 1.1.1.1
# as-domain: cloudflare.com
# as-name: Cloudflare, Inc.
# asn: AS13335
# continent: OC
# continent-name: Oceania
# country: AU
# country-name: Australia
#
# % IP address data provided by https://ipinfo.io
```