https://github.com/root4loot/nsfinder
DNS resolver discovery
https://github.com/root4loot/nsfinder
discovery dns nameserver osint reconnaissance
Last synced: 16 days ago
JSON representation
DNS resolver discovery
- Host: GitHub
- URL: https://github.com/root4loot/nsfinder
- Owner: root4loot
- License: mit
- Created: 2025-09-03T14:53:47.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-03T16:58:48.000Z (9 months ago)
- Last Synced: 2025-12-17T20:22:18.534Z (6 months ago)
- Topics: discovery, dns, nameserver, osint, reconnaissance
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nsfinder
[](https://github.com/root4loot/nsfinder/actions/workflows/ci.yml)
A tool to find DNS resolvers for a target (domain or IP) using:
- WHOIS nameserver extraction
- NS record traversal
- ASN-based IP range scanning
- Port 53 scanning (UDP/TCP)
- Curated public DNS resolvers
## Quick Start
```bash
go get github.com/root4loot/nsfinder/pkg/nsfinder
```
```go
package main
import (
"fmt"
"time"
"github.com/root4loot/nsfinder/pkg/nsfinder"
)
func main() {
finder := nsfinder.NewFinder(&nsfinder.Options{
EnableWhois: true,
EnableNSLookup: true,
EnablePortScan: false, // Can be slow
Concurrency: 10,
Timeout: 30 * time.Second,
})
go func() {
for result := range finder.Results {
if result.Error == nil {
fmt.Printf("Found: %s from %s (target: %s)\n",
result.Resolver, result.Source, result.Target)
}
}
}()
finder.FindStream("example.com", "test.com")
}
```
## Configuration Options
```go
type Options struct {
EnableWhois bool // Extract nameservers from whois data
EnableNSLookup bool // Follow NS record chains
EnablePortScan bool // Scan for port 53 services
EnableASNLookup bool // Use ASN data for IP range finding
EnableDNSGrab bool // Use existing dnsgrab functionality
Timeout time.Duration // Timeout for operations
Concurrency int // Number of concurrent workers
Verbose bool // Verbose logging
}
```
## Core Types
```go
type Finder struct {
Options *Options
Results chan Result
}
type Result struct {
Resolver string // The found DNS resolver
Source string // Finding method (whois, ns-records, etc.)
Target string // Original target
Error error // Any error encountered
}
```
## Example Usage
```go
package main
import (
"fmt"
"log"
"time"
"github.com/root4loot/nsfinder/pkg/nsfinder"
)
func main() {
finder := nsfinder.NewFinder(&nsfinder.Options{
EnableWhois: true,
EnableNSLookup: true,
EnablePortScan: false,
EnableASNLookup: false,
EnableDNSGrab: false,
EnablePublicResolvers: true,
Concurrency: 10,
Timeout: 30 * time.Second,
Verbose: true,
})
fmt.Println("Stream")
go func() {
for result := range finder.Results {
if result.Error != nil {
log.Printf("Error: %s - %v", result.Target, result.Error)
} else {
fmt.Printf("Found: %s from %s (target: %s)\n",
result.Resolver, result.Source, result.Target)
}
}
}()
finder.FindStream("example.com", "hackerone.com")
time.Sleep(10 * time.Second)
}
// Found: a.ns.hackerone.com:53 from whois (target: hackerone.com)
// Found: b.ns.hackerone.com:53 from whois (target: hackerone.com)
// Found: a.ns.hackerone.com:53 from ns-records (target: hackerone.com)
// Found: 162.159.0.31:53 from ns-records (target: hackerone.com)
// Found: [2400:cb00:2049:1::a29f:1f]:53 from ns-records (target: hackerone.com)
// ...
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Add tests for new functionality
4. Ensure all tests pass
5. Submit a pull request
## License
MIT License - see LICENSE file for details.