All Projects → bogdanovich → dns_resolver

bogdanovich / dns_resolver

Licence: MIT license
Simple dns resolver in Go based on miekg/dns.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to dns resolver

Massdns
A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)
Stars: ✭ 2,093 (+2847.89%)
Mutual labels:  dns-resolver
QuickScan
Port scanning and domain utility.
Stars: ✭ 26 (-63.38%)
Mutual labels:  dns-resolver
dns-resolver-infra
Privacy DNS infrastructure
Stars: ✭ 39 (-45.07%)
Mutual labels:  dns-resolver
Fresh-Resolvers
List of Hourly Updated Fresh DNS resolvers
Stars: ✭ 55 (-22.54%)
Mutual labels:  dns-resolver
harddns
RFC8484 and DoH/JSON resolver
Stars: ✭ 35 (-50.7%)
Mutual labels:  dns-resolver

Simple dns resolver implemented in go

Build Status Go Walker

Based on based on miekg/dns.

Features

  • Uses provided dns servers array in random order
  • Retries dns requests in case of i/o timeout

Installing

Using go get

$ go get github.com/bogdanovich/dns_resolver

After this command dns_resolver is ready to use. Its source will be in:

$GOPATH/src/github.com/bogdanovich/dns_resolver

Example

package main

import (
	"log"
	"github.com/bogdanovich/dns_resolver"
)

func main() {
	resolver := dns_resolver.New([]string{"8.8.8.8", "8.8.4.4"})
	// OR
	// resolver := dns_resolver.NewFromResolvConf("resolv.conf")

	// In case of i/o timeout
	resolver.RetryTimes = 5

	ip, err := resolver.LookupHost("google.com")
	if err != nil {
		log.Fatal(err.Error())
	}
	log.Println(ip)
	// Output [216.58.192.46]
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].