Package: openvpn2dns
OpenVPN 2 DNS=============|Build Status|A pure python DNS server serving the content of OpenVPN status files. Itparses the status files of the OpenVPN server to extract the connectedclients and their IP addresses. From theses data OpenVPN2DNS creates DNSzones and serving they as DNS server (using Python's twisted module).Afterwards all connected VPN clients have valid DNS entries.The server supports zone transfers (``AXFR``) and zone update notifiesand can therefore used as master server.Installation------------openvpn2dns depends on:-  Python 2.6 or 2.7 (but Python 2.6 support will likely be dropped inthe nearer future)-  ```twisted`` python module <https://pypi.python.org/pypi/Twisted/>`__- versions >= 10 working-  ```IPy`` python module <https://pypi.python.org/pypi/IPy/>`__ - atleast versions >= 0.73 workingOn most system all dependencies are available via the package manager -look for package names like ``python``/``python2``/``python2.7``,``python-twisted``/``python-twisted-names`` and ``python-ipy``. Thetwisted packages contains multiple submodules but openvpn2dns requiresonly the ``core`` part and the ``names`` submodule. You do not need toinstall the whole suite.Currently openvpn2dns is only available via source (but I administrativethinking about building Debian/Ubuntu packages), e.g.:::git clone git://github.com/mswart/openvpn2dns.gitIf python is installed the needed Python modules can also be installedvia the Python Package Index and package manager like ``pip``\ (or``easy_install``), e.g.:::pip install -r requirements.txt# orpip install twisted IPyConfiguration-------------openvpn2dns uses a INI-style file configuration but handles and supportsmultiple option with the same name per section.``options`` section - general option~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-  **listen**: Specify on which address and port the DNS server shouldlisten. You must specify the a port (DNS default port is 53). Thisoption can be specify multiple times.-  **instance**: Define one OpenVPN instance (one status file thatshould be served). The value is the name for the zone and the sectionthat contains options above this instance.-  **daemon**: Whether detach and run as daemon-  **drop-privileges**: Whether drop privileges after opened sockets.User and group information needed (via option or config)-  **user**: User id or name to use when dropping privileges afteropened sockets (see drop-privileges option)-  **group**: Group id or name to use when dropping privileges afteropened sockets (see drop-privileges option)-  **log**: Log destination (file name, ``-`` for stdout or ``syslog``for syslog)-  **pidfile**: Name of the pidfile, recommended for daemon mode-  **reactor**: twisted reactor type for twistedinstance section~~~~~~~~~~~~~~~~This section is used to set up the zone and e.g. ``SOA`` entry for thezone. The section and all its options must be specified.-  **rname**: A which specifies the mailbox of the person responsiblefor this zone.-  **mname**: The of the name server that was the original or primarysource of data for this zone.-  **refresh**: A 32 bit time interval in seconds before the zone shouldbe refreshed. String suffixes like ``h``, ``d`` are supported.-  **retry**: A 32 bit time interval that should elapse before a failedrefresh should be retried. String suffixes like ``h``, ``d`` aresupported.-  **expire**: A 32 bit time value that specifies the upper limit on thetime interval that can elapse before the zone is no longerauthoritative. String suffixes like ``h``, ``d`` are supported.-  **minimum**: The unsigned 32 bit minimum TTL field that should beexported with any RR from this zone. String suffixes like ``h``,``d`` are supported.The following options define needed information about the OpenVPNserver:-  **status\_file**: The path to the OpenVPN status file.-  **subnet4**: ipv4 subnet of the OpenVPN server. If set openvpn2dnsserves also reverse lookups.-  **subnet6**: ipv6 subnet of the OpenVPN server. If set openvpn2dnsserves also reverse lookups.They can be specify directly or extracted from the OpenVPN serverconfiguration:-  **server\_config**: The path to the OpenVPN configuration file. Thevalues for **status\_file**, **subnet4** and **subnet6** areextracted.The following options are optional:-  **notify**: A DNS name or IP address for other DNS server whichworking as slaves and should be notified via the DNS notify extensionabove zone updates. This option can be specify multiple times.-  **add\_entries**: name of one entry section thats records should beadded to the zone of this instance.-  **add\_forward\_entries**: name of one entry section thats recordsshould be added to the forward zone of this instance.-  **add\_backward\_entries**: name of one entry section thats recordsshould be added to the backward zone (IPv4 and IPv6) of thisinstance.-  **add\_backward4\_entries**: name of one entry section thats recordsshould be added to the backward zone (only IPv4) of this instance.-  **add\_backward6\_entries**: name of one entry section thats recordsshould be added to the backward zone (only IPv6) of this instance.-  **suffix**: zone suffix that should be appended to all certificatecommon names - needed if the common names are no full-qualifieddomain names. The shortcut ``@`` references the zone name.entry section - additional (static) DNS entries~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This section contains entries that should be added to the dynamicentries from the status file. This should be administrative entries likename servers (NS) or entries for the VPN server.The option name is the record name. If the name does not end with a dot,the zone name is appended. The ``@`` means the zone name itself.All common types like ``A``, ``AAAA``, ``MX``, ``NS`` are supported.Example~~~~~~~.. code:: ini[options]# run settings:listen = 192.0.2.1:53listen = 198.51.100.1:53# instancesinstances = vpn.example.org[vpn.example.org]# data source:status_file = /etc/openvpn/openvpn-status.log# notify slaves:notify = dns.example.orgnotify = dns-backup.example.com# zone SOA options:rname = dns@example.orgmname = vpn.example.orgrefresh = 1hretry = 5mexpire = 2hminimum = 5m# additional zone entries:add_entries = nameserversadd_entries = vpn-server[nameservers]@ = NS dns.example.org@ = NS dns-backup.example.com[vpn-server]@ = A 203.0.113.1Starting--------Launch openvpn2dns with ``openvpn2dns`` and pass the file name of yourconfiguration file:::python2 openvpn2dns <configuration file like openvpn2dns.ini>The most options setting can be specified by command line options. Toget a complete list and help run:::python2 openvpn2dns --helpProduction Usage----------------``openvpn2dns`` is stable and usable for production service.To handle a higher query count run openvpn2dns as hidden master DNSserver and use optimized DNS server to handle the query load.``openvpn2dns`` supports zone transfers and the ``notify`` option pusheschances fast to slave servers.The server is written python and security holes are therefore unlikely.But to be sure it is recommended to specify a ``user`` and ``group`` andset ``drop-privileges`` to ``true``: the process drops all privilegesafter opened the network sockets.**Warning:** ``openvpn2dns`` does no access control. All clients canquery every data from the DNS zone or transfer the entire zone. Adjustthe firewall to block unwanted connections.The ``scripts`` directory contains a ``upstart`` and a ``init.d``script. You can copy them. You may want to replace the launch andconfiguration path inside the scripts.**Info:** The ``init.d`` passes ``--daemon=yes`` and``--pidfile=/var/run/openvpn2dns.pid`` via command line arguments.Values for these options inside the configuration file have no effect.Contributing------------1. Fork it2. Create your feature branch (``git checkout -b my-new-feature``)3. Add specs for your feature4. Implement your feature5. Commit your changes (``git commit -am 'Add some feature'``)6. Push to the branch (``git push origin my-new-feature``)7. Create new Pull RequestLicense-------MIT LicenseCopyright (c) 2013 Malte Swart. MIT license, see LICENSE for moredetails... |Build Status| image:: https://travis-ci.org/mswart/openvpn2dns.png?branch=master:target: https://travis-ci.org/mswart/openvpn2dns