/resolv

Go package for retrieving DNS resolver IP addresses used by the macOS system

Primary LanguageGoMIT LicenseMIT

resolv

The missing function from net package


This package provides local DNS resolver IP addresses used by the macOS system.

Installation

Use the go command:

go get -u github.com/romantomjak/resolv

Example

package main

import (
	"fmt"

	"github.com/romantomjak/resolv"
)

func main() {
	addrs, err := resolv.ServerAddrs()
	if err != nil {
		panic(err)
	}

	for k, v := range addrs {
		fmt.Printf("DNS Resolver #%d: %s\n", k, v)
	}
}

License

MIT