mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
net/dns: fix darwin dns resolver files
putting each nameserver on one line in /etc/resolver/<domain> fixes: #10134 Signed-off-by: Juergen Knaack <jk@jk-1.de>
This commit is contained in:
parent
cbd0b60743
commit
c27aa9e7ff
@ -36,15 +36,11 @@ func (c *darwinConfigurator) SupportsSplitDNS() bool {
|
||||
func (c *darwinConfigurator) SetDNS(cfg OSConfig) error {
|
||||
var buf bytes.Buffer
|
||||
buf.WriteString(macResolverFileHeader)
|
||||
for i, ip := range cfg.Nameservers {
|
||||
if i == 0 {
|
||||
buf.WriteString("nameserver ")
|
||||
} else {
|
||||
buf.WriteString(" ")
|
||||
}
|
||||
for _, ip := range cfg.Nameservers {
|
||||
buf.WriteString("nameserver ")
|
||||
buf.WriteString(ip.String())
|
||||
buf.WriteString("\n")
|
||||
}
|
||||
buf.WriteString("\n")
|
||||
|
||||
if err := os.MkdirAll("/etc/resolver", 0755); err != nil {
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user