Compare commits

..

3 Commits

Author SHA1 Message Date
5a7c784680 moved log to ResponseWrapper 2022-04-03 22:37:22 +02:00
fb818b86a2 removed debug line 2022-04-03 16:15:08 +02:00
8dc088ffde improved README 2022-04-03 16:14:48 +02:00
3 changed files with 5 additions and 8 deletions

View File

@@ -4,10 +4,9 @@ I made this to override the public IP address of my server with its VPN IP addre
There is probably a better way to do this, but I couldn't find it.
# Usage
Add this to your `plugin.cfg`:
Add this to your `plugin.cfg` beetween `minimal` and `template` :
```
override:git.kapelle.org/niklas/coredns-override
override:git.kapelle.org/niklas/coredns-override
```
In your `Corefile`:

View File

@@ -3,9 +3,12 @@ package override
import (
"net"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/miekg/dns"
)
var log = clog.NewWithPlugin("override")
type Rule struct {
Search net.IP
Override net.IP

View File

@@ -6,11 +6,8 @@ import (
"github.com/coredns/caddy"
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
clog "github.com/coredns/coredns/plugin/pkg/log"
)
var log = clog.NewWithPlugin("overide")
func init() {
plugin.Register("override", setup)
}
@@ -22,8 +19,6 @@ func setup(c *caddy.Controller) error {
return plugin.Error("override", err)
}
log.Debug(rules)
dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {
return Override{Next: next, Rules: rules}
})