14 * Launch name: ``godbc``
16 The Generic ODBC Backend (godbc) is a child of the Generic SQL (gsql)
17 backend, similar to the gmysql and gpgsql backends. It uses
18 `UnixODBC <http://www.unixodbc.org/>`__ and installed drivers to connect
19 to the databases supported by said drivers.
22 When there is a more specific generic sql backend (like
23 goracle or gmysql), it is highly recommended to use that backend
29 When building PowerDNS yourself, append ``godbc`` to ``--with-modules``
30 or ``--with-dynmodules``. It is expected that most pre-built packages
31 contain this backend or be separately installable.
33 Configuration Parameters
34 ------------------------
36 This section only details the configuration of PowerDNS for use with
37 ODBC. For ODBC related configuration, please see UnixODBC
38 website/documentation and the documentation for the driver you intend to
41 .. _setting-godbc-datasource:
49 The datasource (DSN) to use. This must be configured in the ``odbc.ini``
50 file, usually found in ``/etc/``, but this depends your local setup.
52 .. _setting-godbc-username:
60 The user to connect to the datasource.
62 .. _setting-godbc-password:
70 The password to connect with the datasource.
72 Connecting to Microsoft SQL Server
73 ----------------------------------
76 In order to connect to Microsoft SQL Server, you will need at
77 least version 3.2.0 of UnixODBC. FreeDTS has been tested with versions
80 Install the `FreeTDS <http://www.freetds.org/>`__ driver for UnixODBC,
81 either by compiling or getting it from our distribution's repository and
82 configure your ``/etc/odbcinst.ini`` with the driver, e.g.:
87 Description=v0.95.8 with protocol v7.1
88 Driver=/usr/local/lib/libtdsodbc.so
91 And add the datasource to your ``/etc/odbc.ini``, e.g:
98 Server=server.example.net
103 (For our tests, we add ``ClientCharset=UTF-8`` as well. YMMV.)
105 You can now test the connection with ``isql pdns1 USERNAME PASSWORD``.
107 Loading the schema into the database
108 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110 For convenience, a schema for MS SQL Server has been created: (Note:
111 This schema can also be found in the PowerDNS source as
112 ``modules/godbcbackend/schema.mssql.sql``).
114 .. literalinclude:: ../../modules/godbcbackend/schema.mssql.sql
116 Load this into the database as follows:
120 cat schema.mssql.sql | tr '\n' ' ' | isql pdns1 USERNAME PASSWORD -b.
122 Loading records into the database
123 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
125 Loading records is the same as with any SQL backend, just add them using
126 SQL-queries. Should you want to use :ref:`zone2sql <migration-zone2sql>`,
127 use the ``--sqlite`` option for correctly formatted SQL.
132 Add the options required to your ``pdns.conf``:
137 godbc-datasource=pdns1
138 godbc-username=USERNAME
139 godbc-password=PASSWORD
141 Now restart PowerDNS and you're done. Just don't forget to add zones and
142 records to the database.
147 It might be that you need to compile FreeTDS with the
148 ``--tds-version=7.1`` to connect to SQL Server.
150 When connecting to a database hosted with Microsoft Azure, FreeTDS must
151 be compiled with OpenSSL, use the ``--with-openssl`` configure flag.