https://github.com/mrjosh/go-dns-changer
🌎Golang DNS changer
https://github.com/mrjosh/go-dns-changer
change-dns-with-golang dns dns-changer dns-golang go-dns-changer golang
Last synced: 4 months ago
JSON representation
🌎Golang DNS changer
- Host: GitHub
- URL: https://github.com/mrjosh/go-dns-changer
- Owner: mrjosh
- License: mit
- Created: 2020-03-07T00:03:54.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2020-03-07T00:27:03.000Z (over 5 years ago)
- Last Synced: 2025-03-06T06:39:10.626Z (4 months ago)
- Topics: change-dns-with-golang, dns, dns-changer, dns-golang, go-dns-changer, golang
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### This project is under construction.
# Golang DNS Changer
This is a DNS changer library written in Golang.## Notes
- IMPORTANT: Requires root/sudo/admin privileges to adjust any settings.
- Tested on:
- macOS (Sierra, High Sierra, mojave, catalina)## Installing
```bash
$ go get github.com/MrJoshLab/go-dns-changer
```## Usage
Standard usage:
```go
package mainimport (
"github.com/MrJoshLab/go-dns-changer"
"log"
)func main() {
interfaces := []string{"Wi-Fi"}
dnsServers := []string{"8.8.8.8", "8.8.4.4"}// you can debug with SetDebugMode to true!
gdc.SetDebugMode(true)if err := gdc.SetDnsServers(interfaces, dnsServers); err != nil {
switch err.(type) {
case *gdc.Error:
log.Fatal(err.(*gdc.Error).CommandOutput())
return
}
log.Fatal(err)
}}
```## Contributing
Thank you for considering contributing to the this project!## License
The go-dns-changer is open-source software licensed under the MIT license.