https://github.com/root4loot/publicresolvers
Go library/CLI tool for fetching DNS resolver lists from the Trickest Resolvers repository
https://github.com/root4loot/publicresolvers
go golang resolvers
Last synced: 7 months ago
JSON representation
Go library/CLI tool for fetching DNS resolver lists from the Trickest Resolvers repository
- Host: GitHub
- URL: https://github.com/root4loot/publicresolvers
- Owner: root4loot
- License: mit
- Created: 2023-04-25T19:13:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-06T16:15:19.000Z (about 2 years ago)
- Last Synced: 2025-02-17T12:45:39.510Z (10 months ago)
- Topics: go, golang, resolvers
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# publicresolvers
publicresolvers is a simple Go library and CLI tool for fetching DNS resolver lists from the Trickest Resolvers [repository](https://github.com/trickest/resolvers).
## Installation
### Go
```
go install github.com/root4loot/publicresolvers/cmd/publicresolvers@latest
```
### Docker
```
git clone https://github.com/root4loot/publicresolvers.git && cd publicresolvers
docker build -t publicresolvers .
docker run -it publicresolvers -h
```
## Usage
```
Usage: publicresolvers [flag]
-r, --resolvers fetch resolvers.txt (resolver IP addresses)
-t, --trusted fetch resolvers-trusted.txt (trusted resolvers from organizations like Cloudflare, Google, etc.)
-c, --community fetch resolvers-community.txt (resolver IP addresses with community annotations)
-p, --with-port include port 53 in resolver IP addresses
-h, --help display help
```
## Example
```
publicresolvers --resolvers
204.74.109.172
204.69.234.244
204.106.240.53
202.65.192.146
202.65.124.32
202.63.241.68
202.129.206.237
...
```
```
publicresolvers --resolvers --with-port
204.74.109.172:53
204.69.234.244:53
204.106.240.53:53
202.65.192.146:53
202.65.124.32:53
202.63.241.68:53
202.129.206.237:53
...
```
## Library
```
go get github.com/root4loot/publicresolvers
```
```go
package main
import (
"fmt"
"github.com/root4loot/publicresolvers"
)
func main() {
resolvers, err := publicresolvers.FetchResolvers()
if err != nil {
fmt.Println("Error fetching resolvers:", err)
return
}
fmt.Println(resolvers)
trustedResolvers, err := publicresolvers.FetchResolversTrusted()
if err != nil {
fmt.Println("Error fetching trusted resolvers:", err)
return
}
fmt.Println(trustedResolvers)
communityResolvers, err := publicresolvers.FetchResolversCommunity()
if err != nil {
fmt.Println("Error fetching community resolvers:", err)
return
}
fmt.Println(communityResolvers)
}
```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)