mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-30 14:40:15 +02:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user