@ -232,22 +232,22 @@ func (m windowsManager) SetDNS(cfg OSConfig) error {
// configuration only, routing one set of things to the "split"
// configuration only, routing one set of things to the "split"
// resolver and the rest to the primary.
// resolver and the rest to the primary.
if cfg . Primary {
if len ( cfg . MatchDomains ) == 0 {
if err := m . setSplitDNS ( nil , nil ) ; err != nil {
if err := m . setSplitDNS ( nil , nil ) ; err != nil {
return err
return err
}
}
if err := m . setPrimaryDNS ( cfg . Nameservers , cfg . Domains) ; err != nil {
if err := m . setPrimaryDNS ( cfg . Nameservers , cfg . Search Domains) ; err != nil {
return err
return err
}
}
} else if ! m . nrptWorks {
} else if ! m . nrptWorks {
return errors . New ( "cannot set per-domain resolvers on Windows 7" )
return errors . New ( "cannot set per-domain resolvers on Windows 7" )
} else {
} else {
if err := m . setSplitDNS ( cfg . Nameservers , cfg . Domains) ; err != nil {
if err := m . setSplitDNS ( cfg . Nameservers , cfg . Match Domains) ; err != nil {
return err
return err
}
}
// Still set search domains on the interface, since NRPT only
// Still set search domains on the interface, since NRPT only
// handles query routing and not search domain expansion.
// handles query routing and not search domain expansion.
if err := m . setPrimaryDNS ( nil , cfg . Domains) ; err != nil {
if err := m . setPrimaryDNS ( nil , cfg . Search Domains) ; err != nil {
return err
return err
}
}
}
}
@ -297,9 +297,7 @@ func (m windowsManager) SupportsSplitDNS() bool {
}
}
func ( m windowsManager ) Close ( ) error {
func ( m windowsManager ) Close ( ) error {
return m . SetDNS ( OSConfig {
return m . SetDNS ( OSConfig { } )
Primary : true ,
} )
}
}
// getBasePrimaryResolver returns a guess of the non-Tailscale primary
// getBasePrimaryResolver returns a guess of the non-Tailscale primary