You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-20Lines changed: 37 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,40 @@
1
-
# mysql
1
+
# MySQL
2
+
2
3
MySQL backend for CoreDNS
3
4
4
-
## Supported Record Types
5
+
## Name
6
+
MySQL - MySQL backend for CoreDNS
7
+
8
+
## Description
9
+
10
+
This plugin uses MySQL as a backend to store DNS records. These will then can served by CoreDNS. The backend uses a simple, single table data structure that can be shared by other systems to add and remove records from the DNS server. As there is no state stored in the plugin, the service can be scaled out by spinning multiple instances of CoreDNS backed by the same database.
11
+
12
+
## Syntax
13
+
```
14
+
mysql {
15
+
dsn DSN
16
+
[table_prefix TABLE_PREFIX]
17
+
[max_lifetime MAX_LIFETIME]
18
+
[max_open_connections MAX_OPEN_CONNECTIONS]
19
+
[max_idle_connections MAX_IDLE_CONNECTIONS]
20
+
[ttl DEFAULT_TTL]
21
+
[zone_update_interval ZONE_UPDATE_INTERVAL]
22
+
}
23
+
```
24
+
25
+
`dsn` DSN for MySQL as per https://github.com/go-sql-driver/mysql examples. You can use `$ENV_NAME` format in the DSN, and it will be replaced with the environment variable value.
26
+
`table_prefix` Prefix for the MySQL tables. Defaults to `coredns_`.
27
+
`max_lifetime` Duration (in Golang format) for a SQL connection. Default is 1 minute.
28
+
`max_open_connections` Maximum number of open connections to the database server. Default is 10.
29
+
`max_idle_connections` Maximum number of idle connections in the database connection pool. Default is 10.
30
+
`ttl` Default TTL for records without a specified TTL in seconds. Default is 360 (seconds)
31
+
`zone_update_interval` Maximum time interval between loading all the zones from the database. Default is 10 minutes.
32
+
33
+
##3 Supported Record Types
5
34
6
35
A, AAAA, CNAME, SOA, TXT, NS, MX, CAA and SRV. This backend doesn't support AXFR requests. It also doesn't support wildcard records yet.
7
36
8
-
## Setup
37
+
## Setup (as an external plugin)
9
38
10
39
Add this as an external plugin in `plugin.cfg` file:
11
40
@@ -22,18 +51,6 @@ $ go build
22
51
23
52
Add any required modules to CoreDNS code as prompted.
24
53
25
-
## Configuration
26
-
27
-
In the Corefile, `mysql` can be configured with the following parameters:
28
-
29
-
`dsn` DSN for MySQL as per https://github.com/go-sql-driver/mysql examples. You can use `$ENV_NAME` format in the DSN, and it will be replaced with the environment variable value.
30
-
`table_prefix` Prefix for the MySQL tables. Defaults to `coredns_`.
31
-
`max_lifetime` Duration (in Golang format) for a SQL connection. Default is 1 minute.
32
-
`max_open_connections` Maximum number of open connections to the database server. Default is 10.
33
-
`max_idle_connections` Maximum number of idle connections in the database connection pool. Default is 10.
34
-
`ttl` Default TTL for records without a specified TTL in seconds. Default is 360 (seconds)
35
-
`zone_update_interval` Maximum time interval between loading all the zones from the database. Default is 10 minutes.
36
-
37
54
## Database Setup
38
55
This plugin doesn't create or migrate database schema for its use yet. To create the database and tables, use the following table structure (note the table name prefix):
39
56
@@ -55,16 +72,16 @@ Each record served by this plugin, should belong to the zone it is allowed to se
55
72
```sql
56
73
-- Insert batch #1
57
74
INSERT INTO coredns_records (zone, name, ttl, content, record_type) VALUES
0 commit comments