All Pages > howto > Looking glasses
lglass is a Python software package designed for Internet Registries like the DN42. You can generate zone files for DNS and rDNS IPv4/v6, and handle the registry. It is available on GitHub as free software:
Links
Running your own Whois daemon
lglass provides an event-based whois daemon with internal caching, which was written in Python. It is very simple to run an instance:
without the configfile:
usage: lglass-whoisd [-h] [-4] [-6] [--host HOST] [--port PORT]
[--cidr] [--no-cidr] [--inverse] [--no-inverse]
optional arguments:
-h, --help show this help message and exit
-4 Listen on IPv4
-6 Listen on IPv6
--host HOST, -H HOST Listen on host
--port PORT, -p PORT Listen on port
--cidr, -c Perform CIDR matching on queries
--no-cidr Do not perform CIDR matching on queries
--inverse, -i Perform inverse matching on queries
--no-inverse Do not perform inverse matching on queries
Generate zone files
lglass also provides a script to generate zone files from the registry. It's named zonegen.py and requires a registry dump from Monotone.
To generate DNS zones:
To generate IPv4 rDNS zones:
To generate IPv6 rDNS zones:
Reformat RPSL files
You can also reformat RPSL files using lglass by using the lglass.rpsl module:
lglass.rpsl also supports in-place operation:
This opens the file, reads the content into memory, seeks to position 0, writes the formatted object and truncates the file. Simple web interface
lglass also comes with a simple web interface written in Python3 using Bottle and Jinja2. It also provides a binary to run it using wsgiref:
Furthermore you can use any WSGI server like Gunicorn by using lglass.web.application:app as WSGI callback. You can provide a path to the configuration file in the environment variable LGLASS_WEB_CFG
.
Configuration
The configuration file format is JSON and allows configuration of the database chain, the listen parameters, the custom messages and the process management.
Option | Meaning |
---|---|
listen.host | IP address for listening socket (Default: ::) |
listen.port | TCP port for listening socket (Default: 4343) |
listen.protocol | Protocol for listening socket (4 or 6, by default 6) |
database | Array of database URLs to initialize database chain |
database.types | Array of object types in database (Default: undefined) Default chain: [ "whois+lglass.database.file+file:.", "whois+lglass.database.cidr+cidr:", "whois+lglass.database.schema+schema:", "whois+lglass.database.cache+cached:" ] |
messages.preamble | String preamble for whois responses |
messages.help | String help message for help requests |
process.user | User to change after initialization |
process.group | Group to change after initialization |
process.pidfile | Path to PID file |
RPSL
- Routing Policy Specification Language RFC2622
- Routing Policy Specification Language next generation (RPSLng) RFC4012
- http://www.ripe.net/data-tools/db/rpsl
- http://www.ripe.net/data-tools/db/rpsl/transition-to-rpsl-version-of-the-ripe-database