Skip to content
/ dnsring Public

Ring of DNS servers for spreading IP lookups over multiple DNS servers

License

Notifications You must be signed in to change notification settings

toxyl/dnsring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnsring

Ring of DNS servers for spreading IP lookups over multiple DNS servers. Uses an in-memory cache to avoid repeated lookups. Only returns the first IP if matches and prefers IPv4 over IPv6.

Usage Example

    DNSRing := dnsring.New(dns.NewServer("8.8.8.8", 53, 2000), dns.NewServer("8.8.4.4", 53, 2000))
    host := "google.com"
	ip := DNSRing.Next().HostToIP(host)
	if ip == "" {
        fmt.Printf("%s did not resolve to an IP\n", host)
	} else {
        fmt.Printf("%s has the IP: %s\n", host, ip)
    }

About

Ring of DNS servers for spreading IP lookups over multiple DNS servers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages