mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
feat: add "nearest.<service>.internal" mode to internal DNS (#159)
* feat: Adding a "nearest.service.local" mode to internal DNS
* Pass listenAddr to internal DNS server (rather than calling into network.MachineIP)
Also adds an exact round-robin via "rr.{service}" mode. Not sure we want that over random or not, though.
* Remove the resolved count and rotating round-robin. "rr.name" mode is now the same as default with random shuffle.
* Add test on nearest internal DNS lookup
* Add docs on internal DNS order modes
This commit is contained in:
@@ -430,7 +430,12 @@ func (m *Machine) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
dnsResolver := dns.NewClusterResolver(m.store)
|
||||
dnsServer, err := dns.NewServer(m.IP(), dnsResolver, m.config.DNSUpstreams)
|
||||
dnsServer, err := dns.NewServer(
|
||||
m.IP(),
|
||||
m.state.Network.Subnet,
|
||||
dnsResolver,
|
||||
m.config.DNSUpstreams,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create embedded DNS server: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user