Compare commits

..

4 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
6ff47b2a29 fixed rules parsing & debug 2022-04-03 01:44:37 +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,18 +6,13 @@ 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)
}
func setup(c *caddy.Controller) error {
c.Next()
rules, err := parseRules(c)
if err != nil {