{"id":21740904,"url":"https://github.com/whois-api-llc/dns-lookup-go","last_synced_at":"2025-06-12T10:08:12.816Z","repository":{"id":57748305,"uuid":"523354209","full_name":"whois-api-llc/dns-lookup-go","owner":"whois-api-llc","description":"DNS Lookup API client library for Go","archived":false,"fork":false,"pushed_at":"2022-08-10T13:32:19.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-21T01:15:33.429Z","etag":null,"topics":["dns","dns-lookup","go","golang","whoisxmlapi"],"latest_commit_sha":null,"homepage":"https://dns-lookup.whoisxmlapi.com/api","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whois-api-llc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-10T13:26:54.000Z","updated_at":"2024-09-14T07:24:03.000Z","dependencies_parsed_at":"2022-09-11T18:50:15.627Z","dependency_job_id":null,"html_url":"https://github.com/whois-api-llc/dns-lookup-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/whois-api-llc/dns-lookup-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fdns-lookup-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fdns-lookup-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fdns-lookup-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fdns-lookup-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whois-api-llc","download_url":"https://codeload.github.com/whois-api-llc/dns-lookup-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whois-api-llc%2Fdns-lookup-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259444930,"owners_count":22858545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","dns-lookup","go","golang","whoisxmlapi"],"created_at":"2024-11-26T06:15:51.726Z","updated_at":"2025-06-12T10:08:12.792Z","avatar_url":"https://github.com/whois-api-llc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![dns-lookup-go license](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![dns-lookup-go made-with-Go](https://img.shields.io/badge/Made%20with-Go-1f425f.svg)](https://pkg.go.dev/github.com/whois-api-llc/dns-lookup-go)\n[![dns-lookup-go test](https://github.com/whois-api-llc/dns-lookup-go/workflows/Test/badge.svg)](https://github.com/whois-api-llc/dns-lookup-go/actions/)\n\n# Overview\n\nThe client library for\n[DNS Lookup API](https://dns-lookup.whoisxmlapi.com/)\nin Go language.\n\nThe minimum go version is 1.17.\n\n# Installation\n\nThe library is distributed as a Go module\n\n```bash\ngo get github.com/whois-api-llc/dns-lookup-go\n```\n\n# Examples\n\nFull API documentation available [here](https://dns-lookup.whoisxmlapi.com/api/documentation/making-requests)\n\nYou can find all examples in `example` directory.\n\n## Create a new client\n\nTo start making requests you need the API Key. \nYou can find it on your profile page on [whoisxmlapi.com](https://whoisxmlapi.com/).\nUsing the API Key you can create Client.\n\nMost users will be fine with `NewBasicClient` function. \n```go\nclient := dnslookupapi.NewBasicClient(apiKey)\n```\n\nIf you want to set custom `http.Client` to use proxy then you can use `NewClient` function.\n```go\ntransport := \u0026http.Transport{Proxy: http.ProxyURL(proxyUrl)}\n\nclient := dnslookupapi.NewClient(apiKey, dnslookupapi.ClientParams{\n    HTTPClient: \u0026http.Client{\n        Transport: transport,\n        Timeout:   20 * time.Second,\n    },\n})\n```\n\n## Make basic requests\n\nDNS Lookup API lets you get well-structured a domain’s corresponding IP address from its A record as well as the domain’s mail server (MX record), nameserver (NS record), SPF (TXT record), and more records.\n\n```go\n\n// Make request to get all parsed DNS records for the domain name\ndnsLookupResp, resp, err := client.Get(ctx, \"whoisxmlapi.com\")\nif err != nil {\n    log.Fatal(err)\n}\n\nfor _, record := range dnsLookupResp.DNSRecords.A {\n    log.Println(record.Name)\n    log.Println(record.Address)\n}\n\n// Make request to get raw DNS Lookup API data\nresp, err := client.GetRaw(context.Background(), \"whoisxmlapi.com\")\nif err != nil {\n    log.Fatal(err)\n}\n\nlog.Println(string(resp.Body))\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhois-api-llc%2Fdns-lookup-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhois-api-llc%2Fdns-lookup-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhois-api-llc%2Fdns-lookup-go/lists"}