Commit graph

11 commits

Author SHA1 Message Date
Thomas Mangin
4b402e000d plugin/hosts provide more configuration flexibility (#2535)
* plugin/hosts provide more configuration flexibility

This patch adds few features to the host plugin
 * no-reverse (both as first argument on the plugin line and inline)
   disable the automatic generation of reserve entries for hosts
 * ttl <duration> (inline only atm)
   allows to change the default ttl (default 5 minutes)
 * reload <duration> (inline only atm)
   allows to change the reloading interval (default 5s)

* plugin/hosts remove superfluous parameters to parse
2019-02-12 09:09:33 -07:00
Manuel Stocker
4b1b0ec9e6 Use filepath when manipulating file paths (#2221)
Automatically submitted.
2018-10-21 13:59:37 +00:00
Miek Gieben
12b2ff9740
Use logging (#1718)
* update docs

* plugins: use plugin specific logging

Hooking up pkg/log also changed NewWithPlugin to just take a string
instead of a plugin.Handler as that is more flexible and for instance
the Root "plugin" doesn't implement it fully.

Same logging from the reload plugin:

.:1043
2018/04/22 08:56:37 [INFO] CoreDNS-1.1.1
2018/04/22 08:56:37 [INFO] linux/amd64, go1.10.1,
CoreDNS-1.1.1
linux/amd64, go1.10.1,
2018/04/22 08:56:37 [INFO] plugin/reload: Running configuration MD5 = ec4c9c55cd19759ea1c46b8c45742b06
2018/04/22 08:56:54 [INFO] Reloading
2018/04/22 08:56:54 [INFO] plugin/reload: Running configuration MD5 = 9e2bfdd85bdc9cceb740ba9c80f34c1a
2018/04/22 08:56:54 [INFO] Reloading complete

* update docs

* better doc
2018-04-22 21:40:33 +01:00
Miek Gieben
26d1432ae6
Update all plugins to use plugin/pkg/log (#1694)
* Update all plugins to use plugin/pkg/log

I wish this could have been done with sed. Alas manually changed all
callers to use the new plugin/pkg/log package.

* Error -> Info

* Add docs to debug plugin as well
2018-04-19 07:41:56 +01:00
Miek Gieben
f697b33283
return an error for multiple use of some plugins (#1559)
* plugins: Return error for multiple use of some

Return plugin.ErrOnce when a plugin that doesn't support it, is called
mutliple times.

This now adds it for: cache, dnssec, errors, forward, hosts, nsid.
And changes it slightly in kubernetes, pprof, reload, root.

* more tests
2018-02-28 18:16:05 -08:00
John Belamaric
c59f5f6e86
Simplify plugin/pkg/fall (#1358)
* Simplify plugin/pkg/fall

* Remove unused import

* Fix fall_test

* Get fall coverage to 100% just because

* gofmt. sigh.
2018-01-07 14:51:32 -05:00
Miek Gieben
c6febe6250
Add pkg/fall for Fallthrough (#1355)
* Add pkg/fall for Fallthrough

Move this into it's own package to facilitate tests. Important bug
was fixed: make the names fully qualified.

Add fall package to hosts, reverse, etcd, and fix kubernetes and any
tests. The k8s tests are still as-is, might need a future cleanup.
2018-01-07 16:32:59 +00:00
Pat Moroney
1d4ac4adbb add goroutine to check hosts file for updates (#1180)
* add goroutine to check hosts file for updates

* rename parseFile to parseReader, remove extra error check
2017-10-31 07:40:47 +00:00
John Belamaric
37d06f382a Warn if the hosts file is a directory (#1126) 2017-09-29 22:28:37 +01:00
Yong Tang
7109c6715c Add inline support for middleware/hosts (#1072)
This fix add inline support for middleware/hosts so that
it is possible to specify hosts file insides the Corefile:
```
hosts inline example.org {
    10.0.0.1 example.org
    fallthrough
}
```

This fix fixes 999.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-21 04:18:13 -07:00
Miek Gieben
d8714e64e4 Remove the word middleware (#1067)
* Rename middleware to plugin

first pass; mostly used 'sed', few spots where I manually changed
text.

This still builds a coredns binary.

* fmt error

* Rename AddMiddleware to AddPlugin

* Readd AddMiddleware to remain backwards compat
2017-09-14 09:36:06 +01:00
Renamed from middleware/hosts/setup.go (Browse further)