Feature/dns-server (#537)

Adding DNS server for client

Updated the API with new fields

Added custom zone object for peer's DNS resolution
This commit is contained in:
Maycon Santos
2022-11-03 18:39:37 +01:00
committed by GitHub
parent 6aa7a2c5e1
commit e8d82c1bd3
21 changed files with 1245 additions and 20 deletions

View File

@ -3,6 +3,7 @@ package internal
import (
"context"
"fmt"
"github.com/netbirdio/netbird/client/internal/dns"
"github.com/netbirdio/netbird/client/internal/routemanager"
nbssh "github.com/netbirdio/netbird/client/ssh"
nbstatus "github.com/netbirdio/netbird/client/status"
@ -103,6 +104,8 @@ type Engine struct {
statusRecorder *nbstatus.Status
routeManager routemanager.Manager
dnsServer *dns.Server
}
// Peer is an instance of the Connection Peer
@ -130,6 +133,7 @@ func NewEngine(
networkSerial: 0,
sshServerFunc: nbssh.DefaultSSHServer,
statusRecorder: statusRecorder,
dnsServer: dns.NewServer(ctx),
}
}
@ -190,6 +194,10 @@ func (e *Engine) Stop() error {
e.routeManager.Stop()
}
if e.dnsServer != nil {
e.dnsServer.Stop()
}
log.Infof("stopped Netbird Engine")
return nil