]> git.ipfire.org Git - thirdparty/pdns.git/blob - docs/manpages/zone2sql.1.rst
rec: Update new b-root-server.net addresses in built-in hints.
[thirdparty/pdns.git] / docs / manpages / zone2sql.1.rst
1 zone2sql
2 ========
3
4 Synopsis
5 --------
6
7 :program:`zone2sql` {**--named-conf=**\ *PATH*,\ **--zone-file=**\ *PATH* [**--zone-name=**\ *NAME*]} [*Options*]
8
9 Description
10 -----------
11
12 :program:`zone2sql` parses BIND named.conf files and zonefiles and outputs SQL
13 on standard out, which can then be fed to your database.
14
15 :program:`zone2sql` understands the BIND master file extension ``$GENERATE``
16 and will also honour ``$ORIGIN`` and ``$TTL``.
17
18 For backends supporting slave operation there is also an option to keep
19 slave zones as slaves, and not convert them to native operation.
20
21 :program:`zone2sql` can generate SQL for the Generic MySQL, Generic PostgreSQL,
22 Generic SQLite3 backend.
23
24 Options
25 -------
26
27 INPUT Options
28 -------------
29
30 --named-conf=<PATH> Read *PATH* to get the BIND configuration
31 --zone=<PATH> Parse only the zone file at *PATH* Conflicts with **--named-conf** parameter.
32 --zone-name=<NAME> When parsing a single zone without $ORIGIN statement, set *ZONE* as
33 the zone name.
34
35 BACKENDS
36 --------
37
38 --gmysql
39 Output in format suitable for the default configuration of the
40 Generic MySQL backend.
41 --gpgsql
42 Output in format suitable for the default configuration of the
43 Generic PostgreSQL backend.
44 --gsqlite
45 Output in format suitable for the default configuration of the
46 Generic SQLite3 backend.
47
48 OUTPUT Options
49 --------------
50
51 --json-comments
52 Parse JSON in zonefile comments to set the 'disabled' and 'comment'
53 fields in the database. See *JSON COMMENTS* for more information.
54 --transactions
55 If the target SQL backend supports transactions, wrap every domain
56 into a transaction for integrity and possibly higher speed.
57
58 OTHER Options
59 -------------
60
61 --filter-duplicate-soa
62 If there's more than one SOA record in the zone (possibly because it
63 was AXFR'd), ignore it. If this option is not set, all SOA records
64 in the zone are emitted.
65 --help
66 List all options
67 --on-error-resume-next
68 Ignore missing zone files during parsing. Dangerous.
69 --slave
70 Maintain slave status of zones listed in named.conf as being slaves.
71 The default behaviour is to convert all zones to native operation.
72 --verbose
73 Be verbose during conversion.
74
75 JSON COMMENTS
76 -------------
77
78 The Generic SQL backends have the 'comment' and 'disabled' fields in the
79 'records' table. The 'comment' field contains a comment for this record
80 (if any) and the 'disabled' field tells PowerDNS if the record can be
81 served to clients.
82
83 When a zonefile contains a comment like
84 ``; json={"comment": "Something", "disabled": true}`` and
85 **--json-comments** is provided, the 'comment' field will contain
86 "Something" and the 'disabled' field will be set to the database's
87 native true value.
88
89 WARNING: Using JSON comments to disable records means that the zone in
90 PowerDNS is different from the one served by BIND, as BIND does not
91 handle the disabled status in the comment.
92
93 See also
94 --------
95
96 pdns_server(1)