1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 var payload *strings.Reader = nil
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v2.0/dns/live?apiKey=API_KEY&domainName=whoisfreaks.com&ipAddress=8.8.8.8&type=all", payload)
13 client := &http.Client{}
14 resp, _ := client.Do(req)
15 defer resp.Body.Close()
16 body, _ := ioutil.ReadAll(resp.Body)
17 fmt.Println(string(body))
18}1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 var payload *strings.Reader = nil
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v2.0/dns/historical?apiKey=API_KEY&domainName=whoisfreaks.com&type=all&page=1", payload)
13 client := &http.Client{}
14 resp, _ := client.Do(req)
15 defer resp.Body.Close()
16 body, _ := ioutil.ReadAll(resp.Body)
17 fmt.Println(string(body))
18}1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 var payload *strings.Reader = nil
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v2.1/dns/reverse?apiKey=API_KEY&format=json&value=8.8.8.8&type=a", payload)
13 client := &http.Client{}
14 resp, _ := client.Do(req)
15 defer resp.Body.Close()
16 body, _ := ioutil.ReadAll(resp.Body)
17 fmt.Println(string(body))
18}1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 payload := strings.NewReader("{"domainNames": ["whoisfreaks.com","jfreaks.com"],"ipAddresses": ["1.1.1.1","8.8.8.8"]}")
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v2.0/dns/bulk/live?apiKey=API_KEY&type=all&format=json", payload)
13 req.Header.Set("Content-Type", "application/json")
14 client := &http.Client{}
15 resp, _ := client.Do(req)
16 defer resp.Body.Close()
17 body, _ := ioutil.ReadAll(resp.Body)
18 fmt.Println(string(body))
19}The SDK allows you to perform live, historical, and reverse DNS lookups. You can retrieve comprehensive domain name system records, which are essential for network analysis, troubleshooting, and ensuring proper domain configurations. This feature is ideal for developers managing DNS data and conducting network diagnostics.
This package is for performing any type of DNS lookup, such as live, historical, or reverse lookups.
To utilize the WhoisFreaks Go SDK for DNS Lookups of domain names or IP addresses, follow these steps:
To authenticate your API requests, set your API key using the SetAPIKey method provided by the SDK. This method sets the global API key to the specified value.
func SetAPIKey(key string)Parameters:
Example Usage:
package main
import (
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
// Your code here
}Replace "your_api_key" with your actual API key.
GetLiveResponse performs a live DNS lookup using the WhoisFreaks API. It retrieves real-time DNS information for a specific domain and DNS type.
func GetLiveResponse(dnsType, domain string) (*modal.DNSInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/dns"
)
func main() {
dns.SetAPIKey("your_api_key")
domain := "example.com"
dnsType := "A" // Replace with desired DNS record type (e.g., "A", "MX", "CNAME", "AAAA", "NS", "TXT", "SOA", "SPF")
result, err := dns.GetLiveResponse(dnsType, domain)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace domain with the domain you wish to query and dnsType with the desired DNS record type (e.g., "A", "MX", "CNAME").
GetHistoricalResponse performs a historical DNS lookup using the WhoisFreaks API. It retrieves historical DNS information for a specific domain and DNS type.
func GetHistoricalResponse(dnsType, domain, page string) (*modal.HistoricalDnsInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/dns"
)
func main() {
dns.SetAPIKey("your_api_key")
domain := "example.com"
dnsType := "A" // Replace with desired DNS record type
page := "1" // Optional: specify the page number for paginated results
result, err := dns.GetHistoricalResponse(dnsType, domain, page)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace "example.com" with the domain you wish to query, adjust dnsType as needed, and specify the page number if necessary.
GetReverseResponse performs a reverse DNS lookup using the WhoisFreaks API.
func GetReverseResponse(dnsType, value, page string) (*modal.ReverseDnsInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/dns"
)
func main() {
dns.SetAPIKey("your_api_key")
ipAddress := "8.8.8.8" // Replace with the IP address you wish to query
dnsType := "A" // Replace with desired DNS record type
page := "1" // Optional: specify the page number for paginated results
result, err := dns.GetReverseResponse(dnsType, ipAddress, page)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace "8.8.8.8" with the IP address you wish to query, adjust dnsType as needed, and specify the page number if necessary.
Offers live, reverse, historical, IP, ASN, and bulk domain WHOIS lookups.
Provides live, reverse, historical, and bulk DNS lookup services.
Checks domain availability across TLDs and suggests alternatives.
Performs SSL lookup and shows certificate chain from start to present.

Leverage this Go Lang-based SDK and CLI tool to interact with the WhoisFreaks API seamlessly.
pkg.go.dev