### Install Retryable DNS Library Source: https://github.com/projectdiscovery/retryabledns/blob/main/README.md Install the retryabledns library using go get. This command downloads the source code into your Go workspace. ```bash go get github.com/projectdiscovery/retryabledns ``` -------------------------------- ### Basic DNS Resolution Example Source: https://github.com/projectdiscovery/retryabledns/blob/main/README.md Demonstrates how to create a new retryabledns client and resolve a hostname to IP addresses. Supports custom resolvers, retry counts, and various protocols. ```go package main import ( "log" "github.com/projectdiscovery/retryabledns" "github.com/miekg/dns" ) func main() { // 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, err := retryabledns.New(resolvers, retries) if err != nil { log.Fatal(err) } ips, err := dnsClient.Resolve(hostname) if err != nil { log.Fatal(err) } log.Println(ips) // Query Types: dns.TypeA, dns.TypeNS, dns.TypeCNAME, dns.TypeSOA, dns.TypePTR, dns.TypeMX, dns.TypeANY // dns.TypeTXT, dns.TypeAAAA, dns.TypeSRV (from github.com/miekg/dns) // retryabledns.ErrRetriesExceeded will be returned if a result isn't returned in max retries dnsResponses, err := dnsClient.Query(hostname, dns.TypeA) if err != nil { log.Fatal(err) } log.Println(dnsResponses) } ``` -------------------------------- ### Configure Hosts File Processing Limit Source: https://github.com/projectdiscovery/retryabledns/blob/main/README.md Adjust the maximum number of lines processed from the /etc/hosts file. The default is 4096 lines. ```go hostsfile.MaxLines = 10000 // Now the library will process up to 10000 lines from the hosts file ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.