https://github.com/romantomjak/resolv
Go package for retrieving DNS resolver IP addresses used by the macOS system
https://github.com/romantomjak/resolv
cgo corefoundation dns dns-resolver macos scdynamicstore
Last synced: about 1 month ago
JSON representation
Go package for retrieving DNS resolver IP addresses used by the macOS system
- Host: GitHub
- URL: https://github.com/romantomjak/resolv
- Owner: romantomjak
- License: mit
- Created: 2020-02-13T23:55:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-13T23:55:46.000Z (over 6 years ago)
- Last Synced: 2025-05-31T23:15:14.814Z (about 1 year ago)
- Topics: cgo, corefoundation, dns, dns-resolver, macos, scdynamicstore
- Language: Go
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# resolv
The missing function from [net](https://golang.org/pkg/net/) package
---
This package provides local DNS resolver IP addresses used by the macOS system.
## Installation
Use the go command:
```sh
go get -u github.com/romantomjak/resolv
```
## Example
```go
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