Skip to content

Commit

Permalink
docs: update example usage
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <[email protected]>
  • Loading branch information
dwisiswant0 committed Aug 20, 2024
1 parent 37aa936 commit 23f07cb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ import (
)

func main() {
// it requires a list of resolvers
resolvers := []string{"8.8.8.8:53", "8.8.4.4:53"}
// It requires a list of resolvers.
// Valid protocols are "udp", "tcp", "doh", "dot". Default are "udp".
resolvers := []string{"8.8.8.8:53", "8.8.4.4:53", "tcp:1.1.1.1"}
retries := 2
hostname := "hackerone.com"
dnsClient := retryabledns.New(resolvers, retries)

dnsClient, err := retryabledns.New(resolvers, retries)
if err != nil {
log.Fatal(err)
}

ips, err := dnsClient.Resolve(hostname)
if err != nil {
Expand Down

0 comments on commit 23f07cb

Please sign in to comment.